Main Content

Function 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.

fgoalattain, fminbnd, fmincon, fminimax, fminsearch, fminunc, fseminf, fsolve, fzero, linprog, quadprog

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.

fmincon, fminunc

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 Output.

fmincon, fminunc

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.

lsqcurvefit, lsqnonlin, fsolve

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.)

fgoalattain, fmincon, fminimax, fseminf, linprog, lsqcurvefit, lsqlin, lsqnonlin, lsqnonneg, quadprog

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.

lsqcurvefit, lsqlin, lsqnonlin, lsqnonneg

resnorm

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

lsqcurvefit, lsqlin, lsqnonlin, lsqnonneg

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

Related Topics