12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

6 Argument and Options ReferenceStates of the AlgorithmThefollowingtableliststhepossiblevaluesforstate:State'init''interrupt''iter''done'DescriptionThe algorithm is in the initial state before the firstiteration.The algorithm is in some computationally expensivepart of the iteration. In this state, the output functioncan interrupt the current iteration of the optimization.At this time, the values of x and optimValues are thesame as at the last call to the output function in whichstate=='iter'.The algorithm is at the end of an iteration.The algorithm is in the final state after the last iteration.The following code illustrates how the output function might use the value ofstate to decide which tasks to perform at the current iteration:switch statecase 'iter'% Make updates to plot or guis as neededcase 'interrupt'% Probably no action here. Check conditions to see% whether optimization should quit.case 'init'% Setup for plots or guiscase 'done'% Cleanup of plots, guis, or final plototherwiseendStop FlagThe output argument stop is a flag that is true or false. The flag tells theoptimization function whether the optimization should quit or continue. Thefollowing examples show typical ways to use the stop flag.6-24

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

Saved successfully!

Ooh no, something went wrong!