Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- w_oc = polyval(polyfit(x,y,4),a)
- %(A - maciesz 5 x 5+2)
- for i =1:5
- A(i,1) = x(i);
- A(i,3) = y(i);
- A(i,2) = x(i)-a;
- endfor
- for k = 4:7
- r=k-3;
- for i=k-2:5
- A(i,k) = (A(i-1,k-1)*A(i,2) - A(i,k-1)*A(i-r,2))/(A(i,1)-A(i-r,1));
- endfor;
- endfor;
- format short;
- A
- format long;
- wynik = A(5,5+2);
- bl= abs(A(5,5+2) - A(5-1,5+1)); % Roznica dwoc
- wd = cbrt(1.15)
- bl
- wynik
- brz = abs(wd-wynik)
- brz <= bl % Czy dobre szacowanie bledu
Add Comment
Please, Sign In to add comment