function[f] = Bisection(a,b,Nmax,TOL) f = x^3 - x^2 + x; i=1; BisectA=f(a); whilei <= Nmax p=a+(b-a)/2; BisectP=f(p); ifBisectP == 0 || (b-a)/2 < TOL disp('p'); end i=i+1; ifBisectA*BisectP > 0 a=p; BisectA=Bis