root/applications/dual/SIDP/bakalarka/SIDPS/matlab/motor_sidps/find_in_hyperstate5.m @ 1351

Revision 1351, 422 bytes (checked in by zimamiro, 13 years ago)
Line 
1function index=find_in_hyperstate5(state,hyperstate)
2
3index=1;
4len=(state(1,1)-hyperstate(1,1,1))^2+(state(1,2)-hyperstate(1,1,2))^2;
5%plot(hyperstate(1,:,1),hyperstate(1,:,2),'b+'); hold on
6%plot(state(1,1),state(1,2),'r.');
7
8for i=2:size(hyperstate,2)
9    pom2=(state(1,1)-hyperstate(1,i,1))^2+(state(1,2)-hyperstate(1,i,2))^2;   
10    if pom2<len
11        len=pom2;
12        index=i;
13    end
14end
15   
16end
Note: See TracBrowser for help on using the browser.