Paste: Netwon's Method in ML

Author: Rex
Mode: ml
Date: Fri, 29 Jan 2010 14:41:31
Plain Text |
% Rex's sad implementation of newton's method
function sol = newton(f,f_prime,guess,tol)
max_its=10;
i=0;
sol=guess;
while i<max_its && abs(f(sol))>tol
    %Error if f_prime(sol)==0...
   sol=sol-(f(sol)/f_prime(sol));
   i=i+1;
end

New Annotation

Summary:
Author:
Mode:
Body: