Monday, January 11, 2010

Matlab - simple newton's method ex



function r = doNewton(f,x0,x,err)

while abs(x0 - x) > err

x0, (x0 - x)

x0 = x0 - (polyval(f,x0))/polyval(polyder(f),x0);


end



r = x0;
end

No comments:

Post a Comment