root/applications/dual/SIDP/SIDPS/motor_sidps/interpol.m
@
1323
Revision 1249, 0.5 kB (checked in by zimamiro, 14 years ago) |
---|
Line | |
---|---|
1 | function rizeni=interpol(beta,H,C,H_tilde_on) |
2 | i=(1:4)*H_tilde_on*ones(5,1); |
3 | j=ones(1,4)*H_tilde_on*[1;2;3;4;5]; |
4 | pom=H-beta(i,j); |
5 | |
6 | if (pom(1)>0) |
7 | rizeni=C(1); |
8 | else |
9 | if (pom(end)<0 || pom(end)==0) |
10 | rizeni=C(end)*2^pom(end); |
11 | else |
12 | for i=2:size(H,2) |
13 | if (pom(i)>0) |
14 | delka=H(i)-H(i-1); |
15 | rizeni=(1+pom(i-1)/delka)*C(i-1)+(1-pom(i)/delka)*C(i); |
16 | break |
17 | end |
18 | end |
19 | end |
20 | end |
21 | |
22 | end |
Note: See TracBrowser
for help on using the browser.