B =
In this context, you should be avoiding inline() and feval() . You should either be proceeding symbolically, or else you should be using matlabFunction()
It is unlikely that you really want to input() inside the loop; your should be calculating a and b instead.
if fc==accuracy
Your code is confused there. First off, you have used exact comparison of binary floating point numbers: those are unlikely to happen to match bit-for-bit. Secondly, suppose the exact root was -0.05 and accuracy was 0.10 and fc happened to come out exactly as 0.10, then you would compare the fc to the accuracy, find an exact match, and declare yourself satisfied, even though fc was not within 0.10 accuracy of -0.05 . You should just get rid of that branch of code; your next line about abs(b-a) is good enough.
