| Contents | Index |
To solve an optimization problem:
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.
Write your objective function and, if applicable, constraint functions per the syntax in Computing Objective Functions and Constraints.
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.
Run the solver.
Examine the result. For information on the result, see Examining Results in the Optimization Toolbox documentation or Examining Results for GlobalSearch or MultiStart.
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.
![]() | What Is Global Optimization? | Choosing a Solver | ![]() |

Learn how to use optimization to solve systems of equations, fit models to data, or optimize system performance.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |