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 thatf(
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 elementsYou can use the function
fsolve_options
to set optional parameters forfsolve
.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 byoptimset, fsolve_options
.