15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Minimizing Functions and Finding Zeros<br />

Setting Minimization Options<br />

You can specify control options that set some minimization parameters using<br />

an options structure that you create using the function optimset. You then<br />

pass options as in input to the optimization function, for example, by calling<br />

fminbnd with the syntax<br />

x = fminbnd(fun,x1,x2,options)<br />

or fminsearch with the syntax<br />

x = fminsearch(fun,x0,options)<br />

Use optimset to set the values <strong>of</strong> the options structure. For example, to set<br />

the 'Display' option to 'iter', in order to display output from the algorithm<br />

at each iteration, enter<br />

options = optimset('Display','iter');<br />

fminbnd and fminsearch use only the options parameters shown in the<br />

following table.<br />

options.Display<br />

options.TolX<br />

options.TolFun<br />

options.MaxIter<br />

options.MaxFunEvals<br />

A flag that determines if intermediate steps in the<br />

minimization appear on the screen. If set to 'iter',<br />

intermediate steps are displayed; if set to '<strong>of</strong>f', no<br />

intermediate solutions are displayed, if set to final,<br />

displays just the final output.<br />

The termination tolerance for x. Its default value is<br />

1.e-4.<br />

The termination tolerance for the function value.<br />

The default value is 1.e-4. This parameter is used<br />

by fminsearch, but not fminbnd.<br />

Maximum number <strong>of</strong> iterations allowed.<br />

The maximum number <strong>of</strong> function evaluations<br />

allowed. The default value is 500 for fminbnd and<br />

200*length(x0) for fminsearch.<br />

4-13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!