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