Optimization Toolbox 

Optimization Toolbox can solve linear and nonlinear leastsquares problems, data fitting problems, and nonlinear equations.
The toolbox uses two algorithms for solving constrained linear leastsquares problems:
The toolbox uses two algorithms for solving nonlinear leastsquares problems:
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 leastsquares problems.
Optimization Toolbox implements a dogleg trustregion 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 trustregion reflective and LevenbergMarquardt algorithms.