clear all close all x0=input('Dammi x0 ='); tol=1.e-6; maxit=50; iter= 0; fun1=@(x) 3*log(x)-5*x+6; fun1der=@(x) 3./x-5; stimaerr= -fun1(x0)/fun1der(x0); x1 = x0+stimaerr; x0 = x1; iter = iter+1; while abs(stimaerr) > tol & iter < maxit stimaerr = -fun1(x0)/fun1der(x0); x1= x0+stimaerr; iter = iter+1; x0 = x1; end iter=iter-1 x=x1