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