function x=newton(x0,n) for i=1:n x=x0-f2(x0)/f2d(x0); x0=x; endfor end