Main Content

Function Output Arguments

Argument Description Used by Functions
attainfactor

The attainment factor at the solutionx.

fgoalattain

exitflag

An integer identifying the reason the optimization algorithm terminated. See the function reference pages for descriptions ofexitflagspecific to each function, andExit Flags and Exit Messages.

You can also return a message stating why an optimization terminated by calling the optimization function with the output argumentoutputand then displayingoutput.message.

All functions

fval

The value of the objective functionfunat the solutionx.

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

grad

The value of the gradient offunat the solutionx. Iffundoes not compute the gradient,gradis a finite-differencing approximation of the gradient.

fmincon,fminunc

hessian

The value of the Hessian offunat the solutionx. For large-scale methods, iffundoes not compute the Hessian,hessianis a finite-differencing approximation of the Hessian. For thequasi-newton,active-set, orsqpmethods,hessianis the value of the Quasi-Newton approximation to the Hessian at the solutionx. SeeHessian Output.

fmincon,fminunc

jacobian

The value of the Jacobian offunat the solutionx. Iffundoes not compute the Jacobian,jacobianis a finite-differencing approximation of the Jacobian.

lsqcurvefit,lsqnonlin,fsolve

lambda

The Lagrange multipliers at the solutionx, seeLagrange Multiplier Structures.lambdais a structure where each field is for a different constraint type. For structure field names, see individual function descriptions. (Forlsqnonneg,lambdais simply a vector, aslsqnonnegonly handles one kind of constraint.)

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

maxfval

max{fun(x)}at the solutionx.

fminimax

output

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

All functions

residual

The value of the residual at the solutionx.

lsqcurvefit,lsqlin,lsqnonlin,lsqnonneg

resnorm

The value of the squared 2-norm of the residual at the solutionx.

lsqcurvefit,lsqlin,lsqnonlin,lsqnonneg

x

The solution found by the optimization function. Ifexitflag> 0, thenxis a solution; otherwise,xis the value of the optimization routine when it terminated prematurely.

All functions

Related Topics