clc f1=@(x) exp(-x)-x; function yy=secante(f,xl,xu,es,imax,ea) iter=0; xr=0; while iter<=imax xrold=xr; xr=xl-f(xl)*(xu-xl)/(f(xu)-f(xl)); iter=iter+1; if ne(xr,0) ea=abs((xr-xrold)/xr)*100; end xu=xl; xl=xr; end yy=xr; end fplot(f1,[0 1],'b') grid on; r1=secante(f1,0,1,1,4,2.6); fprintf("El valor de la raiz es = %f \n",r1)