clc f1=@(x) exp(-x)-x; function yy=FalsePos(f,xl,xu,es,imax,xr,iter,ea) iter=0; fl=f(xl); while or((ea0) xl=xr; fl=fr; else ea=0; break; end end yy=xr; end fplot(f1,[0 1],'b') grid on; # (f,xl,xu,es,imax,xr,iter,ea) r1=FalsePos(f1,0,1,3,2,0.25,0,2.6); fprintf("El valor de la raiz es = %f \n",r1)