See First Choose Problem-Based or Solver-Based Approach for choosing between problem-based optimization and solver-based optimization.
Linear least-squares solves min||C*x - d||2, possibly with bounds or linear constraints. See Linear Least Squares.
For the problem-based approach, create problem variables, and then
represent the objective function and constraints in terms of these
symbolic variables. For the problem-based steps to take, see Problem-Based Workflow. To
solve the resulting problem, use
For the solver-based steps to take, including defining the objective
function and constraints, and choosing the appropriate solver, see Solver-Based Optimization Problem Setup. To solve
the resulting problem, use
lsqlin or, for
nonnegative least squares, you can also use
Shows how to solve a linear least-squares problem using the problem-based approach.
Shows how to solve a nonnegative linear least-squares problem using the problem-based approach and several solvers.
Solves an optical deblurring problem using the problem-based approach.
Example showing the Optimization app and linear least squares.
Example showing the use of bounds in nonlinear least squares.
Example showing how to save memory in a large structured linear least-squares problem.
Solves an optical deblurring problem using the solver-based approach.
How the optimization functions and objects solve optimization problems.
Lists all available mathematical and indexing operations on optimization variables and expressions.