# Documentation

## Function Arguments

### Input Arguments

Argument

Description

Used by Functions

`A, b`

The matrix `A` and vector `b` are, respectively, the coefficients of the linear inequality constraints and the corresponding right-side vector: `A*x ≤ b`.

`Aeq, beq`

The matrix `Aeq` and vector `beq` are, respectively, the coefficients of the linear equality constraints and the corresponding right-side vector: `Aeq*x = beq`.

`C, d`

The matrix `C` and vector `d` are, respectively, the coefficients of the over or underdetermined linear system and the right-side vector to be solved.

`f`

The vector of coefficients for the linear term in the linear equation `f'*x` or the quadratic equation `x'*H*x+f'*x`.

`fun`

The function to be optimized. `fun` is either a function handle to a file or is an anonymous function. See the individual function reference pages for more information on `fun`.

`goal`

Vector of values that the objectives attempt to attain. The vector is the same length as the number of objectives.

`fgoalattain`

`H`

The matrix of coefficients for the quadratic terms in the quadratic equation `x'*H*x+f'*x`. `H` must be symmetric.

`quadprog`

`lb, ub`

Lower and upper bound vectors (or matrices). The arguments are normally the same size as `x`. However, if `lb` has fewer elements than `x`, say only `m`, then only the first `m` elements in `x` are bounded below; upper bounds in `ub` can be defined in the same manner. You can also specify unbounded variables using `-Inf` (for lower bounds) or `Inf` (for upper bounds). For example, if `lb(i)` `= -Inf`, the variable `x(i)` is unbounded below.

`nonlcon`

The function that computes the nonlinear inequality and equality constraints. Passing Extra Parameters explains how to parameterize the function `nonlcon`, if necessary.

See the individual reference pages for more information on `nonlcon`.

`ntheta`

The number of semi-infinite constraints.

`fseminf`

`options`

A structure that defines options used by the optimization functions. For information about the options, see Optimization Options Reference or the individual function reference pages.

All functions

`seminfcon`

The function that computes the nonlinear inequality and equality constraints and the semi-infinite constraints. `seminfcon` is the name of a function file or MEX-file. Passing Extra Parameters explains how to parameterize `seminfcon`, if necessary.

See the function reference pages for `fseminf` for more information on `seminfcon`.

`fseminf`

`weight`

A weighting vector to control the relative underattainment or overattainment of the objectives.

`fgoalattain`

`xdata, ydata`

The input data `xdata` and the observed output data `ydata` that are to be fitted to an equation.

`lsqcurvefit`

`x0`

Starting point (a scalar, vector or matrix).

(For `fzero`, `x0` can also be a two-element vector representing a finite interval that is known to contain a zero.)

All functions except `fminbnd`

`x1, x2`

The interval over which the function is minimized.

`fminbnd`

### Output Arguments

ArgumentDescriptionUsed by Functions
`attainfactor`

The attainment factor at the solution `x`.

`fgoalattain`

`exitflag`

An integer identifying the reason the optimization algorithm terminated. See the function reference pages for descriptions of `exitflag` specific to each function, and Exit Flags and Exit Messages.

You can also return a message stating why an optimization terminated by calling the optimization function with the output argument `output` and then displaying `output.message`.

All functions

`fval`

The value of the objective function `fun` at the solution `x`.

`grad`

The value of the gradient of `fun` at the solution `x`. If `fun` does not compute the gradient, `grad` is a finite-differencing approximation of the gradient.

`hessian`

The value of the Hessian of `fun` at the solution `x`. For large-scale methods, if `fun` does not compute the Hessian, `hessian` is a finite-differencing approximation of the Hessian. For the `quasi-newton`, `active-set`, or `sqp` methods, `hessian` is the value of the Quasi-Newton approximation to the Hessian at the solution `x`. See Hessian.

`jacobian`

The value of the Jacobian of `fun` at the solution `x`. If `fun` does not compute the Jacobian, `jacobian` is a finite-differencing approximation of the Jacobian.

`lambda`

The Lagrange multipliers at the solution `x`, see Lagrange Multiplier Structures. `lambda` is a structure where each field is for a different constraint type. For structure field names, see individual function descriptions. (For `lsqnonneg`, `lambda` is simply a vector, as `lsqnonneg` only handles one kind of constraint.)

`maxfval`

`max{fun(x)}` at the solution `x`.

`fminimax`

`output`

An output structure that contains information about the results of the optimization, see Output Structures. For structure field names, see individual function descriptions.

All functions

`residual`

The value of the residual at the solution `x`.

`resnorm`

The value of the squared 2-norm of the residual at the solution `x`.

`x`

The solution found by the optimization function. If ```exitflag > 0```, then `x` is a solution; otherwise, `x` is the value of the optimization routine when it terminated prematurely.

All functions