Revision 1113, 0.6 kB
(checked in by zimamiro, 14 years ago)
|
|
Line | |
---|
1 | function box = make_box3(points)
|
---|
2 | eps=10^-2;
|
---|
3 | dim=2;
|
---|
4 |
|
---|
5 | N=size(points,1);
|
---|
6 | num_of_points=round(N^(1/dim));
|
---|
7 |
|
---|
8 |
|
---|
9 | range=min((max(points)-min(points)),[25 30])';
|
---|
10 | %range=min(3*median(points-ones(N,1)*min(points),1)',range);
|
---|
11 |
|
---|
12 | box=zeros(N,dim);
|
---|
13 | pointer=max(min(points),eps);
|
---|
14 | step=range/(num_of_points-1);
|
---|
15 | jump=[1 num_of_points ];
|
---|
16 | for i=1:N
|
---|
17 | for k=1:dim
|
---|
18 | box(i,k)=pointer(k)+step(k)*mod(floor((i-1)/jump(k)),num_of_points);
|
---|
19 | end
|
---|
20 | end
|
---|
21 |
|
---|
22 | %plot(box(:,1), box(:,2),'b.' ); hold on; plot(meanval(:,1), meanval(:,2), 'g+' );plot(points(:,1), points(:,2), 'r.' ); hold off
|
---|
23 | end |
---|