title: C/C++ implementation of matlab function fzero
body: <p>I am working on converting the matlab function gamfit into objective-c code. Towards the end of gamfit it calls another function called fzero: <a href="http://www.mathworks.com/help/techdoc/ref/fzero.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/fzero.html</a></p>
  
  <p>Even after reading the matlab documentation, I am having trouble understanding how this function operates when x0 is a vector, as it is in my case. </p>
  
  <p>Here is what the matlab documentation says on the subject: "If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero will return a value near a point where fun changes sign."</p>
  
  <p>I was hoping that maybe someone has already implemented this function in C/C++/objective-c to make things easier. </p>
  
  <p>Any help would be appreciated.</p>