Products & Services Solutions Academia Support User Community Company

Learn more about Optimization Toolbox   

Running a Problem in the Optimization Tool

Introduction

After defining your problem and specifying the options, you are ready to run the solver.

To run the selected solver, click the Start button. For most solvers, as the algorithm runs, the Current iteration field updates. This field does not update for solvers for which the current iteration does not apply.

Pausing and Stopping the Algorithm

While the algorithm is running, you can

You can export your results after stopping the algorithm. For details, see Exporting to the MATLAB Workspace.

Viewing Results

When the algorithm terminates, the Run solver and view results window displays the reason the algorithm terminated. To clear the Run solver and view results window between runs, click Clear Results.

Sorting the Displayed Results

Depending on the solver and problem, results can be in the form of a table. If the table has multiple rows, sort the table by clicking a column heading. Click the heading again to sort the results in reverse.

For example, suppose you use the Optimization Tool to solve the bintprog problem described in Example: Investments with Constraints. The result appears as follows.

To sort the results by value, from lowest to highest, click Value.

To sort the results in reverse order, highest to lowest, click Value again.

To return to the original order, click Index. For an example of sorting a table returned by the Genetic Algorithm and Direct Search Toolbox gamultiobj function, see Example — Multiobjective Optimization.

If you export results using File > Export to Workspace, the exported results do not depend on the sorted display.

Displaying Plots

In addition to the Run solver and view results window, you can also display measures of progress while the algorithm executes by generating plots. Each plot selected draws a separate axis in the figure window. You can select a predefined plot function from the Optimization Tool, or you can write your own. For more information on which plot functions are available, see Plot Functions.

Final Point

The Final point updates to show the coordinates of the final point when the algorithm terminated. If you don't see the final point, click the upward-pointing triangle on the icon on the lower-left.

Starting a New Problem

Resetting Options and Clearing the Problem

Selecting File > Reset Optimization Tool resets the problem definition and options to the original default values. This action is equivalent to closing and restarting the optimtool.

To clear only the problem definition, select File > Clear Problem Fields. With this action, fields in the Problem Setup and Results pane are reset to the defaults, with the exception of the selected solver and algorithm choice. Any options that you have modified from the default values in the Options pane are not reset with this action.

Setting Preferences for Changing Solvers

To modify how your options are handled in the Optimization Tool when you change solvers, select File > Preferences, which opens the Preferences dialog box shown below.

The default value, Reset options to defaults, discards any options you specified previously in the optimtool. Under this choice, you can select the option Prompt before resetting options to defaults.

Alternatively, you can select Keep current options if possible to preserve the values you have modified. Changed options that are not valid with the newly selected solver are kept but not used, while active options relevant to the new solver selected are used. This choice allows you to try different solvers with your problem without losing your options.

Closing the Optimization Tool

To close the optimtool window, select File > Close.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS