Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format short
- x = [1.0 , 1.1 , 1.3 , 1.5 , 1.6]
- y = [1.0 , 1.032 , 1.091 , 1.145 , 1.170]
- a = 1.15;
- for i = 1:5
- L(i,1) = x(i);
- L(i,2) = x(i)-a;
- L(i,3) = y(i);
- endfor
- w_oc = polyval(polyfit(x,y,4),a) %wartosc wiel.interp. z Octave w punkcie a
- r=1;
- for i = 2:5
- L(i,4) = (1/(x(r+1) - x(r))) * abs(( y(r) * (x((r+1)) - a)) - (y((r+1)) * (x(r) - a)));
- r++;
- endfor
- r=1;
- for i = 3:5
- L(i,5) = (1/(x(r+2) - x(r))) * abs(( L(i-1,4) * (x((r+2)) - a)) - (L(i,4) * (x(r) - a)));
- r++;
- endfor
- r=1;
- for i = 4:5
- L(i,6) = (1/(x(r+3) - x(r))) * abs(( L(i-1,5) * (x((r+3)) - a)) - (L(i,5) * (x(r) - a)));
- r++;
- endfor
- L(5,7) = (1/(x(5) - x(1))) * abs(( L(4,6) * (x(5) - a)) - (L(5,6) * (x(1) - a)));
- format short;
- L
- format long;
- wynik = L(5,5+2);
- bl= abs(L(5,5+2) - L(5-1,5+1)); % Roznica dwoc
- wd = cbrt(1.15)
- bl
- wynik
- brz = abs(wd-wynik)
- brz <= bl % Czy dobre szacowanie bledu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement