All Algorithms 
Algorithm  Choose the optimization algorithm: 'interiorpoint' (default)
'trustregionreflective'
'sqp'
'sqplegacy' (optimoptions only)
'activeset'
For information on choosing the algorithm, see Choosing the Algorithm. The trustregionreflective algorithm
requires: A gradient to be supplied in the objective function SpecifyObjectiveGradient to be
set to true
Either bound constraints or linear equality constraints,
but not both
If you select the 'trustregionreflective' algorithm
and these conditions are not all satisfied, fmincon throws
an error. The 'activeset' , 'sqplegacy' ,
and 'sqp' algorithms are not largescale. See LargeScale vs. MediumScale Algorithms. 
CheckGradients  Compare usersupplied derivatives
(gradients of objective or constraints) to finitedifferencing derivatives.
Choices are false (default) or true . 
ConstraintTolerance  Tolerance on the constraint violation,
a positive scalar. The default is 1e6 . See Tolerances and Stopping Criteria. 
Diagnostics  Display diagnostic information
about the function to be minimized or solved. Choices are 'off' (default)
or 'on' . 
DiffMaxChange  Maximum change in variables for
finitedifference gradients (a positive scalar). The default is Inf . 
DiffMinChange  Minimum change in variables for
finitedifference gradients (a positive scalar). The default is 0 . 
Display  Level of display (see Iterative Display): 'off' or 'none' displays
no output.
'iter' displays output at each
iteration, and gives the default exit message.
'iterdetailed' displays output
at each iteration, and gives the technical exit message.
'notify' displays output only if
the function does not converge, and gives the default exit message.
'notifydetailed' displays output
only if the function does not converge, and gives the technical exit
message.
'final' (default) displays only
the final output, and gives the default exit message.
'finaldetailed' displays only
the final output, and gives the technical exit message.

FiniteDifferenceStepSize  Scalar or vector step size factor for finite differences. When
you set FiniteDifferenceStepSize to a vector v ,
forward finite differences steps delta are delta
= v.*sign′(x).*max(abs(x),TypicalX);
where sign′(x)
= sign(x) except sign′(0) = 1 .
Central finite differences are delta = v.*max(abs(x),TypicalX);
Scalar FiniteDifferenceStepSize expands
to a vector. The default is sqrt(eps) for forward
finite differences, and eps^(1/3) for central finite
differences. 
FiniteDifferenceType  Finite differences, used to estimate
gradients, are either 'forward' (default), or 'central' (centered). 'central' takes
twice as many function evaluations but should be more accurate. The
trustregionreflective algorithm uses FiniteDifferenceType only
when CheckGradients is set to true . fmincon is
careful to obey bounds when estimating both types of finite differences.
So, for example, it could take a backward, rather than a forward,
difference to avoid evaluating at a point outside bounds. However,
for the interiorpoint algorithm, 'central' differences
might violate bounds during their evaluation if the HonorBounds option
is set to false .

FunValCheck  Check whether objective function
values are valid. The default setting, 'off' , does
not perform a check. The 'on' setting displays
an error when the objective function returns a value that is complex , Inf ,
or NaN . 
MaxFunctionEvaluations  Maximum number of function evaluations
allowed, a positive integer. The default value for all algorithms
except interiorpoint is 100*numberOfVariables ;
for the interiorpoint algorithm the default is 3000 .
See Tolerances and Stopping Criteria and Iterations and Function Counts. 
MaxIterations  Maximum number of iterations allowed,
a positive integer. The default value for all algorithms except interiorpoint is 400 ;
for the interiorpoint algorithm the default is 1000 .
See Tolerances and Stopping Criteria and Iterations and Function Counts. 
OptimalityTolerance  Termination tolerance on the firstorder optimality, a positive
scalar. The default is 1e6 . See FirstOrder Optimality Measure. 
OutputFcn  Specify one or more userdefined
functions that an optimization function calls at each iteration, either
as a function handle or as a cell array of function handles. The default
is none ([] ). See Output Function. 
PlotFcn  Plot various measures of progress
while the algorithm executes, select from predefined plots or write
your own. Pass a function handle or a cell array of function handles.
The default is none ([] ). @optimplotx plots the current point
@optimplotfunccount plots the function
count
@optimplotfval plots the function
value
@optimplotconstrviolation plots
the maximum constraint violation
@optimplotstepsize plots the step
size
@optimplotfirstorderopt plots the
firstorder optimality measure
For information on writing a custom plot function,
see Plot Functions. 
SpecifyConstraintGradient  Gradient for nonlinear constraint
functions defined by the user. When set to the default, false , fmincon estimates
gradients of the nonlinear constraints by finite differences. When
set to true , fmincon expects
the constraint function to have four outputs, as described in nonlcon . The trustregionreflective algorithm
does not accept nonlinear constraints. 
SpecifyObjectiveGradient  Gradient for the objective function
defined by the user. See the description of fun to see how to define the gradient in fun .
The default, false , causes fmincon to
estimate gradients using finite differences. Set to true to
have fmincon use a userdefined gradient of the
objective function. To use the 'trustregionreflective' algorithm,
you must provide the gradient, and set SpecifyObjectiveGradient to true . 
StepTolerance  Termination tolerance on x ,
a positive scalar. The default value for all algorithms except 'interiorpoint' is 1e6 ;
for the 'interiorpoint' algorithm, the default
is 1e10 . See Tolerances and Stopping Criteria. 
TypicalX  Typical x values.
The number of elements in TypicalX is equal to
the number of elements in x0 , the starting point.
The default value is ones(numberofvariables,1) . fmincon uses TypicalX for
scaling finite differences for gradient estimation. The 'trustregionreflective' algorithm
uses TypicalX only for the CheckGradients option. 
UseParallel  When true , fmincon estimates
gradients in parallel. Disable by setting to the default, false . trustregionreflective requires
a gradient in the objective, so UseParallel does
not apply. See Parallel Computing. 
TrustRegionReflective Algorithm 
FunctionTolerance  Termination tolerance on the function
value, a positive scalar. The default is 1e6 .
See Tolerances and Stopping Criteria. 
HessianFcn  If [] (default), fmincon approximates
the Hessian using finite differences, or uses a Hessian multiply function
(with option HessianMultiplyFcn ). If 'objective' , fmincon uses
a userdefined Hessian (defined in fun ). See Hessian as an Input. 
HessianMultiplyFcn  Function handle for Hessian multiply function.
For largescale structured problems, this function computes the Hessian
matrix product H*Y without actually forming H .
The function is of the form where Hinfo contains
a matrix used to compute H*Y . The
first argument is the same as the third argument returned by the objective
function fun , for example Y is
a matrix that has the same number of rows as there are dimensions
in the problem. The matrix W = H*Y , although H is
not formed explicitly. fmincon uses Hinfo to
compute the preconditioner. For information on how to supply values
for any additional parameters hmfun needs, see Passing Extra Parameters.
Note
To use the HessianMultiplyFcn option, HessianFcn must
be set to [] , and SubproblemAlgorithm must
be 'cg' (default). 
See Hessian Multiply Function. See Minimization with Dense Structured Hessian, Linear Equalities for
an example. 

HessPattern  Sparsity pattern of the Hessian
for finite differencing. Set HessPattern(i,j) = 1 when
you can have ∂^{2}fun /∂x(i) ∂x(j) ≠ 0. Otherwise, set HessPattern(i,j)
= 0 . Use HessPattern when
it is inconvenient to compute the Hessian matrix H in fun ,
but you can determine (say, by inspection) when the i th
component of the gradient of fun depends on x(j) . fmincon can
approximate H via sparse finite differences (of
the gradient) if you provide the sparsity structure of H as
the value for HessPattern . In other words, provide
the locations of the nonzeros. When the structure is unknown,
do not set HessPattern . The default behavior is
as if HessPattern is a dense matrix of ones. Then fmincon computes
a full finitedifference approximation in each iteration. This computation
can be very expensive for large problems, so it is usually better
to determine the sparsity structure.  
MaxPCGIter  Maximum number of preconditioned
conjugate gradient (PCG) iterations, a positive scalar. The default
is max(1,floor(numberOfVariables/2)) . For more
information, see Preconditioned Conjugate Gradient Method.  
PrecondBandWidth  Upper bandwidth of preconditioner
for PCG, a nonnegative integer. By default, diagonal preconditioning
is used (upper bandwidth of 0). For some problems, increasing the
bandwidth reduces the number of PCG iterations. Setting PrecondBandWidth to Inf uses
a direct factorization (Cholesky) rather than the conjugate gradients
(CG). The direct factorization is computationally more expensive than
CG, but produces a better quality step towards the solution.  
SubproblemAlgorithm  Determines how the iteration step
is calculated. The default, 'cg' , takes a faster
but less accurate step than 'factorization' . See fmincon Trust Region Reflective Algorithm.  
TolPCG  Termination tolerance on the PCG
iteration, a positive scalar. The default is 0.1 .  
ActiveSet Algorithm  
FunctionTolerance  Termination tolerance on the function
value, a positive scalar. The default is 1e6 .
See Tolerances and Stopping Criteria.  
MaxSQPIter  Maximum number of SQP iterations
allowed, a positive integer. The default is 10*max(numberOfVariables,
numberOfInequalities + numberOfBounds) .  
RelLineSrchBnd  Relative bound (a real nonnegative
scalar value) on the line search step length. The total displacement
in x satisfies Δx(i) ≤ relLineSrchBnd· max(x(i),typicalx(i)).
This option provides control over the magnitude of the displacements
in x for cases in which the solver takes steps
that are considered too large. The default is no bounds ([] ).  
RelLineSrchBndDuration  Number of iterations for which
the bound specified in RelLineSrchBnd should be
active (default is 1 ).  
TolConSQP  Termination tolerance on inner
iteration SQP constraint violation, a positive scalar. The default
is 1e6 .  
InteriorPoint Algorithm  
HessianApproximation  Chooses how fmincon calculates
the Hessian (see Hessian as an Input). The
choices are: Note:
To use HessianApproximation , both HessianFcn and HessianMultiplyFcn must
be empty entries ([] ). 
 
HessianFcn  If [] (default), fmincon approximates
the Hessian using finite differences, or uses a supplied HessianMultiplyFcn .
If a function handle, fmincon uses HessianFcn to
calculate the Hessian. See Hessian as an Input.  
HessianMultiplyFcn  Handle to a usersupplied function
that gives a Hessiantimesvector product (see Hessian Multiply Function). Note
To use the HessianMultiplyFcn option, HessianFcn must
be set to [] , and SubproblemAlgorithm must
be 'cg' . 
 
HonorBounds  The default true ensures
that bound constraints are satisfied at every iteration. Disable by
setting to false .  
InitBarrierParam  Initial barrier value, a positive
scalar. Sometimes it might help to try a value above the default 0.1 ,
especially if the objective or constraint functions are large.  
InitTrustRegionRadius  Initial radius of the trust region,
a positive scalar. On badly scaled problems it might help to choose
a value smaller than the default $$\sqrt{n}$$,
where n is the number of variables.  
MaxProjCGIter  A tolerance (stopping criterion)
for the number of projected conjugate gradient iterations; this is
an inner iteration, not the number of iterations of the algorithm.
This positive integer has a default value of 2*(numberOfVariables  numberOfEqualities) .  
ObjectiveLimit  A tolerance (stopping criterion)
that is a scalar. If the objective function value goes below ObjectiveLimit and
the iterate is feasible, the iterations halt, because the problem
is presumably unbounded. The default value is 1e20 .  
ScaleProblem  'objandconstr' causes
the algorithm to normalize all constraints and the objective function.
Disable by setting to the default 'none' .
 
SubproblemAlgorithm  Determines how the iteration step
is calculated. The default, 'factorization' , is
usually faster than 'cg' (conjugate gradient),
though 'cg' might be faster for large problems
with dense Hessians. See fmincon Interior Point Algorithm.  
TolProjCG  A relative tolerance (stopping
criterion) for projected conjugate gradient algorithm; this is for
an inner iteration, not the algorithm iteration. This positive scalar
has a default of 0.01 .  
TolProjCGAbs  Absolute tolerance (stopping criterion)
for projected conjugate gradient algorithm; this is for an inner iteration,
not the algorithm iteration. This positive scalar has a default of 1e10 .  
SQP and SQP Legacy Algorithms  
ObjectiveLimit  A tolerance (stopping criterion)
that is a scalar. If the objective function value goes below ObjectiveLimit and
the iterate is feasible, the iterations halt, because the problem
is presumably unbounded. The default value is 1e20 .  
ScaleProblem  'objandconstr' causes
the algorithm to normalize all constraints and the objective function.
Disable by setting to the default 'none' .
 