root/applications/dual/SIDP/Kopie (2) - finalni implementace/make_box3.m @ 1166

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