12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

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.

<strong>Optimization</strong> Optionsspecifies OutputFcn to be the handle to outfun. To specify more than oneoutput function, use the syntaxoptions = optimset('OutputFcn', @outfun, @outfun2);3 Call the optimization function with options as an input argument.See “Calling an Output Function Iteratively” on page 2-88 for an exampleof an output function.“Avoiding Global Variables via Anonymous and Nested Functions” onpage 2-20 explains how to parameterize the output function OutputFcn,if necessary.Structure of the Output FunctionThe function definition line of the output function has the following form:stop = outfun(x, optimValues, state)where• x is the point computed by the algorithm at the current iteration.• optimValues is a structure containing data from the current iteration.“Fields in optimValues” on page 6-17 describes the structure in detail.• state is the current state of the algorithm. “States of the Algorithm” onpage 6-24 lists the possible values.• stop is a flag that is true or false depending on whether the optimizationroutine should quit or continue. See “Stop Flag” on page 6-24 for moreinformation.The optimization function passes the values of the input arguments to outfunat each iteration.Fields in optimValuesThe following table lists the fields of the optimValues structure. A particularoptimization function returns values for only some of these fields. For eachfield, the Returned by Functions column of the table lists the functions thatreturn the field.6-17

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

Saved successfully!

Ooh no, something went wrong!