Mathematics |
|
Setting Minimization Options
You can specify control options that set some minimization parameters by calling fminbnd
with the syntax
or fminsearch
with the syntax
options
is a structure used by the optimization functions. Use optimset
to set the values of the options structure.
fminbnd
and fminsearch
use only the options
parameters shown in the following table. See the optimset
reference page for a complete list of the parameters that are used in the Optimization Toolbox.
options.Display
|
A flag that determines if intermediate steps in the minimization appear on the screen. If set to 'iter' , intermediate steps are displayed; if set to 'off' , no intermediate solutions are displayed, if set to final, displays just the final output.
|
options.TolX
|
The termination tolerance for x. Its default value is 1.e-4 .
|
options.TolFun
|
The termination tolerance for the function value. The default value is 1.e-4 . This parameter is used by fminsearch , but not fminbnd .
|
options.MaxIter
|
Maximum number of iterations allowed.
|
options.MaxFunEvals
|
The maximum number of function evaluations allowed. The default value is 500 for fminbnd and 200*length(x0) for fminsearch .
|
The number of function evaluations, the number of iterations, and the algorithm are returned in the structure output
when you provide fminbnd
or fminsearch
with a fourth output argument, as in
[x,fval,exitflag,output] = fminbnd(@humps,0.3,1);
or
[x,fval,exitflag,output] = fminsearch(@three_var,v);
| Minimizing Functions of Several Variables | | Finding Zeros of Functions | |