Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [x] = newton_method(x_0, max_iter, max_error, my_function, function_derivation)
- for i = 1:max_iter
- x = x_0 - feval(my_function, x_0)/feval(function_derivation, x_0);
- if abs(feval(my_function, x)) < max_error
- return;
- end
- x_0 = x;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement