| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Optimization Toolbox |
| Contents | Index |
| Learn more about Optimization Toolbox |
| On this page… |
|---|
The following table is designed to help you choose a solver. It does not address multiobjective optimization or equation solving. There are more details on all the solvers in Problems Handled by Optimization Toolbox Functions.
Use the table as follows:
Identify your objective function as one of five types:
Linear
Quadratic
Sum-of-squares (Least squares)
Smooth nonlinear
Nonsmooth
Identify your constraints as one of five types:
None (unconstrained)
Bound
Linear (including bound)
General smooth
Discrete (integer)
Use the table to identify a relevant solver.
In this table:
Blank entries means there is no Optimization Toolbox solver specifically designed for this type of problem.
* means relevant solvers are found in Genetic Algorithm and Direct Search Toolbox functions (licensed separately from Optimization Toolbox solvers).
fmincon applies to most smooth objective functions with smooth constraints. It is not listed as a preferred solver for least squares or linear or quadratic programming because the listed solvers are usually more efficient.
The table has suggested functions, but it is not meant to unduly restrict your choices. For example, fmincon is known to be effective on some nonsmooth problems.
The Genetic Algorithm and Direct Search Toolbox function ga can be programmed to address discrete problems. It is not listed in the table because additional programming is needed to solve discrete problems.
Solvers by Objective and Constraint
| Constraint Type | Objective Type | ||||
|---|---|---|---|---|---|
| Linear | Quadratic | Least Squares | Smooth nonlinear | Nonsmooth | |
| None | n/a (f =
const, or min =
| quadprog, Theory, Examples | \, lsqcurvefit, lsqnonlin, Theory, Examples | fminsearch, fminunc, Theory, Examples | fminsearch, * |
| Bound | linprog, Theory, Examples | quadprog, Theory, Examples | lsqcurvefit, lsqlin, lsqnonlin, lsqnonneg, Theory, Examples | fminbnd, fmincon, fseminf, Theory, Examples | * |
| Linear | linprog, Theory, Examples | quadprog, Theory, Examples | lsqlin, Theory, Examples | fmincon, fseminf, Theory, Examples | * |
| General smooth | fmincon, Theory, Examples | fmincon, Theory, Examples | fmincon, Theory, Examples | fmincon, fseminf, Theory, Examples | * |
| Discrete | bintprog, Theory, Example | ||||
Note This table does not list multiobjective solvers nor equation solvers. See Problems Handled by Optimization Toolbox Functions for a complete list of problems addressed by Optimization Toolbox functions. |
The following tables show the functions available for minimization, equation solving, multiobjective optimization, and solving least-squares or data-fitting problems.
Minimization Problems
| Type | Formulation | Solver |
|---|---|---|
Scalar minimization |
such that l < x < u (x is scalar) | fminbnd |
Unconstrained minimization |
| |
Linear programming |
such that A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u | |
Quadratic programming |
such that A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u | |
Constrained minimization |
such that c(x) ≤ 0, ceq(x) = 0, A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u | |
Semi-infinite minimization |
such that K(x,w) ≤ 0 for all w, c(x) ≤ 0, ceq(x) = 0, A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u | |
Binary integer programming |
such that A·x ≤ b, Aeq·x = beq, x binary |
Multiobjective Problems
| Type | Formulation | Solver |
|---|---|---|
Goal attainment |
such that F(x) – w·γ ≤ goal, c(x) ≤ 0, ceq(x) = 0, A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u | |
Minimax |
such that c(x) ≤ 0, ceq(x) = 0, A·x ≤ b, Aeq·x = beq, l ≤ x ≤ u |
Equation Solving Problems
| Type | Formulation | Solver |
|---|---|---|
Linear equations | C·x = d, n equations, n variables | \ (matrix left division) |
Nonlinear equation of one variable | f(x) = 0 | |
Nonlinear equations | F(x) = 0, n equations, n variables |
Least-Squares (Model-Fitting) Problems
| Type | Formulation | Solver |
|---|---|---|
Linear least-squares |
m equations, n variables | \ (matrix left division) |
Nonnegative linear-least-squares |
such that x ≥ 0 | |
Constrained linear-least-squares |
such that A·x ≤ b, Aeq·x = beq, lb ≤ x ≤ ub | |
Nonlinear least-squares |
such that lb ≤ x ≤ ub | |
Nonlinear curve fitting |
such that lb ≤ x ≤ ub |
![]() | Introduction to Optimization Toolbox Solvers | Writing Objective Functions | ![]() |

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 |