mihainan

Metode numerice - Lab09

Apr 24th, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.24 KB | None | 0 0
  1. function rez = Neville(x, f, y)
  2.     n = length(x);
  3.     m = length(f);
  4.     temp = f;
  5.     for j=2:n
  6.         for i = n:-1:j
  7.             temp(i) = ((y - x(i-j+1))*temp(i) - (y-x(i))*temp(i-1))/ ...
  8.                 ( x(i) - x(i-j+1);
  9.         endfor
  10.     endfor
  11.     rez = temp(n);
  12. endfunction
Advertisement
Add Comment
Please, Sign In to add comment