clear all close all x=-10:.1:10; y=exp(x)-tan(x); plot(x,y) %define endpoint xl=-4; xr=-2.8; %giant for loop for i=1:10000 xc=(xr+xl)/2; fc=exp(xc)-tan(xc); if fc>0 xl=xc; else xr=xc; end if abs(fc)