Advertisement
STANAANDREY

newton iter

Feb 26th, 2023
1,081
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.17 KB | None | 0 0
  1. function xc = newton(f, df, x0, k)
  2.     x = zeros(1, k + 1);
  3.     x(1) = x0;
  4.     for i=1:k
  5.         x(i + 1) = x(i) - f(x(i))/df(x(i));
  6.     end
  7.     xc = x(k + 1);
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement