Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function xc = newton(f, df, x0, k)
- x = zeros(1, k + 1);
- x(1) = x0;
- for i=1:k
- x(i + 1) = x(i) - f(x(i))/df(x(i));
- end
- xc = x(k + 1);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement