Skip to Main Content Skip to Search
Product Documentation

Optimization Workflow

To solve an optimization problem:

  1. Decide what type of problem you have, and whether you want a local or global solution (see Local vs. Global Optima). Choose a solver per the recommendations in Choosing a Solver.

  2. Write your objective function and, if applicable, constraint functions per the syntax in Computing Objective Functions and Constraints.

  3. Set appropriate options with psoptimset, gaoptimset, or saoptimset, or prepare a GlobalSearch or MultiStart problem as described in How to Optimize with GlobalSearch and MultiStart. For details, see Pattern Search Options, Genetic Algorithm Options, or Simulated Annealing Options.

  4. Run the solver.

  5. Examine the result. For information on the result, see Examining Results in the Optimization Toolbox documentation or Examining Results for GlobalSearch or MultiStart.

  6. If the result is unsatisfactory, change options or start points or otherwise update your optimization and rerun it. For information, see Improving Results, or see When the Solver Fails, When the Solver Might Have Succeeded, or When the Solver Succeeds in the Optimization Toolbox documentation.

  


Free Optimization Interactive Kit

Learn how to use optimization to solve systems of equations, fit models to data, or optimize system performance.

Get free kit

Trials Available

Try the latest version of optimization products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS