Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function x = newtonRaphson(x0, n)
- if g(x0) == 0
- error('The function has derivative zero at x0')
- end
- x = x0;
- for i = 1 : n
- if g(x) == 0
- break;
- end
- x = x - (f(x) / g(x));
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement