ok, here is one algorithm. forgive me if it's newb-ish.
Code:
a = 0;
b = 0;
TOL = 0;
N0 = 0;
p = 0;
i = 1;
a = input('Please enter starting endpoint "a" for the Bisection Method');
b = input('Please enter starting endpoint "b" for the Bisection Method');
TOL = input('Please enter desired tolerance for the Bisection Method');
N0 = input('Please enter maximum number of iterations for the Bisection Method');
FA = f(a);
for i = i:N0
p = a + (b - a) / 2;
FP = f(p);
if FP = 0 | (b - a) / 2 < TOL;
disp(sprintf('%5.6f', p);
end
else i = i + 1;
if FA * FP > 0;
a = p;
FA = FP;
else b = p;
disp('Method failed after N0 iterations, N0 =', N0);
end