Problem structure, returned as an `fmincon`

`problem`

structure,
`fminunc`

`problem`

structure,
`fsolve`

`problem`

structure,
`intlinprog`

`problem`

structure,
`linprog`

`problem`

structure,
`lsqlin`

`problem`

structure,
`lsqnonlin`

`problem`

structure, or
`quadprog`

`problem`

structure.

The following table gives the resulting problem type for optimization
problems.

Optimization Objective and Constraint Types (Linear
Constraints Include Bounds) | Resulting Problem Type |
---|

Linear objective and constraint
functions. At least one problem variable has
the `'integer'` type. | `intlinprog` |

Linear objective and constraint
functions. No problem variable has the
`'integer'` type. | `linprog` |

Linear constraint functions. The
objective function is a constant plus a sum of squares
of linear expressions. | `lsqlin` |

Bound constraints. The objective
function is a constant plus a sum of squares of general
nonlinear expressions. | `lsqnonlin` |

Linear constraint functions. General
quadratic objective function. | `quadprog` |

General nonlinear objective
function. No constraints. | `fminunc` |

General nonlinear objective function, and there is
at least one constraint of any type. Or,
there is at least one general nonlinear constraint
function. | `fmincon` |

The following table gives the resulting problem type for equation solving
problems.

Equation Types | Resulting Problem Type |
---|

Linear system with or without bounds | `lsqlin` |

Scalar (single) nonlinear equation | `fzero` |

Nonlinear system without constraints | `fsolve` |

Nonlinear system with bounds | `lsqnonlin` |

### Note

For nonlinear problems, `prob2struct`

creates
function files for the objective and nonlinear constraint functions. For
objective and constraint functions that call supporting functions,
`prob2struct`

also creates supporting function
files and stores them in the `FileLocation`

folder.

For linear and quadratic optimization problems, the problem structure
includes an additional field, `f0`

, that represents an
additive constant for the objective function. If you solve the problem
structure using the specified solver, the returned objective function value
does not include the `f0`

value. If you solve `prob`

using the `solve`

function, the returned objective function value
includes the `f0`

value.

If the ObjectiveSense of `prob`

is `'max'`

or
`'maximize'`

, then `problem`

uses the
negative of the objective function in `prob`

because
solvers minimize. To maximize, they minimize the negative of the original
objective function. In this case, the reported optimal function value from
the solver is the negative of the value in the original problem. See Maximizing an Objective. You cannot use
`lsqlin`

for a maximization problem.