root/applications/dual/SIDP/Kopie (2) - finalni implementace/make_box2.m @ 1153

Revision 1113, 0.6 kB (checked in by zimamiro, 14 years ago)
Line 
1function [box zero range eigvec]=make_box2(points)
2eps=10^-6;
3%OK
4
5N=size(points,1);
6dim=size(points,2);
7num_of_points=round(N^(1/dim));
8eigvec=eye(2);
9
10range=(max(points)-min(points))';
11
12
13box=zeros(N,dim);
14pointer=min(points);
15step=range/(num_of_points-1);
16jump=[1 num_of_points ];
17for 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
21end 
22
23range=ones(dim,1)./(2*range);
24zero=box(1,:);
25
26%plot(box(:,1), box(:,2),'b.' ); hold on; plot(points(:,1), points(:,2), 'r.' ); hold off
27end
Note: See TracBrowser for help on using the browser.