%Bisection Method %This method will calculate the root of a user-defined function by halving %the given interval until the desired convergence is aquired % %f = function who's root will be found %enda = minimum value at which to look for a root %endb = maximum value at wich to look for a root %TOL = if abs(midp-enda) < TOL, stop searching for a root, where midp %is the midpoint b/w enda & endb %N = maximum number of iterations can use to look for a root function [root] = bisection(f,enda,endb,TOL,N) F_a=f(enda); F_b=f(endb); i=1; %set iteration counter while(i