Mathematics Previous page   Next Page

Setting Minimization Options

You can specify control options that set some minimization parameters using an options structure that you create using the function optimset. You then pass options as in input to the optimization function, for example, by calling fminbnd with the syntax

or fminsearch with the syntax

Use optimset to set the values of the options structure. For example, to set the 'Display' option to 'iter', in order to display output from the algorithm at each iteration, enter

fminbnd and fminsearch use only the options parameters shown in the following table.

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

or


Previous page  Fitting a Curve to Data Output Functions Next page

© 1994-2005 The MathWorks, Inc.