Optimization Toolbox

Nonlinear Least Squares, Data Fitting, and Nonlinear Equations

Optimization Toolbox can solve linear and nonlinear least-squares problems, data fitting problems, and nonlinear equations.

Linear and Nonlinear Least-Squares Optimization

The toolbox uses two algorithms for solving constrained linear least-squares problems:

  • The active-set algorithm is used to solve problems with bounds and linear inequalities or equalities.
  • The trust-region-reflective algorithm is used to solve large-scale problems that have only bound constraints.

The toolbox uses two algorithms for solving nonlinear least-squares problems:

  • The trust-region-reflective algorithm implements the Levenberg-Marquardt algorithm using a trust-region approach. It is used for unconstrained and bound-constrained problems.
  • The Levenberg-Marquardt algorithm implements a standard Levenberg-Marquardt method. It is used for unconstrained problems.
Fitting a transcendental equation using nonlinear least squares.
Fitting a transcendental equation using nonlinear least squares.

Data Fitting

The toolbox provides a specialized interface for data fitting problems in which you want to find the member of a family of nonlinear functions that best fits a set of data points. The toolbox uses the same algorithms for data fitting problems that it uses for nonlinear least-squares problems.

Fitting a nonlinear exponential equation using least-squares curve fitting.
Fitting a nonlinear exponential equation using least-squares curve fitting.

Nonlinear Equation Solving

Optimization Toolbox implements a dogleg trust-region algorithm for solving a system of nonlinear equations where there are as many equations as unknowns. The toolbox can also solve this problem using the trust-region reflective and Levenberg-Marquardt algorithms.

Solving an n-dimensional Rosenbrock function using the nonlinear equation solver.
Solving an n-dimensional Rosenbrock function using the nonlinear equation solver.
Next: Parallel Computing and Derivatives

Try Optimization Toolbox

Get trial software

Tips and Tricks - Getting Started Using Optimization with MATLAB

View webinar

Learn to solve your optimization problems with MATLAB

View course info