function x=newton(x0,n) for i=1:n i; x=x0-func(x0)/funcd(x0); x0=x; endfor