so does it work? if it does... then good...
but i can see your code printing out an infinite amount of
disp(sprintf('%5.6f', p);
if it does find the solution in less than NO iterations....
how about
function answer = bisect(a,b,TOL,NO);
answerfound = 0;
answer = 0;
while (i<NO)&(answerfound=0)......
and
if FP = 0 | (b - a) / 2 < TOL;
answer = p;
answerfound = 1;
end
http://www.mathworks.com/access/help...9.shtml#694422