Function Reference
— Loadable Function: [x, fval, info] = fsolve (fcn, x0, options)

Given fcn, the name of a function of the form f (x) and an initial starting point x0, fsolve solves the set of equations such that f(x) == 0.

On return, fval contains the value of the function fcn evaluated at x, and info may be one of the following values:

1
Algorithm converged with relative error between two consecutive iterates less than or equal to the specified tolerance (see fsolve_options).
0
Iteration limit exceeded.
-1
Error in user-supplied function.
-2
Algorithm failed to converge.

If fcn is a two-element string array, or a two element cell array containing either the function name or inline or function handle. The first element names the function f described above, and the second element names a function of the form j (x) to compute the Jacobian matrix with elements

You can use the function fsolve_options to set optional parameters for fsolve.

If the optional argument options is provided, it is expected to be a structure of the form returned by optimset. Options specified in this structure override any set globally by optimset, fsolve_options.