15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4 Function Functions<br />

Minimizing Functions and Finding Zeros<br />

<strong>MATLAB</strong> provides a number <strong>of</strong> high-level function functions that perform<br />

optimization-related tasks. This section describes the following topics:<br />

• “Minimizing Functions <strong>of</strong> One Variable” on page 4-8<br />

• “Minimizing Functions <strong>of</strong> Several Variables” on page 4-9<br />

• “Fitting a Curve to Data” on page 4-10<br />

• “Setting Minimization Options” on page 4-13<br />

• “Output Functions” on page 4-14<br />

• “Finding Zeros <strong>of</strong> Functions” on page 4-21<br />

The <strong>MATLAB</strong> optimization functions are:<br />

fminbnd<br />

fminsearch<br />

fzero<br />

lsqnonneg<br />

optimget<br />

optimset<br />

Minimize a function <strong>of</strong> one variable on a fixed interval<br />

Minimize a function <strong>of</strong> several variables<br />

Find zero <strong>of</strong> a function <strong>of</strong> one variable<br />

Linear least squares with nonnegativity constraints<br />

Get optimization options structure parameter values<br />

Create or edit optimization options parameter structure<br />

For more optimization capabilities, see the Optimization Toolbox.<br />

Minimizing Functions <strong>of</strong> One Variable<br />

Given a mathematical function <strong>of</strong> a single variable coded in an M-file, you can<br />

use the fminbnd function to find a local minimizer <strong>of</strong> the function in a given<br />

interval. For example, to find a minimum <strong>of</strong> the humps function in the range<br />

(0.3, 1), use<br />

x = fminbnd(@humps,0.3,1)<br />

which returns<br />

x =<br />

0.6370<br />

4-8

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

Saved successfully!

Ooh no, something went wrong!