Optimization Toolbox    

Function Arguments

These tables describe the input arguments and output arguments used by Optimization Toolbox functions. They also list the functions that use each argument.

See the individual function reference pages for function-specific information about these arguments.

Table 4-1: 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-hand side vector: .
fgoalattain, fmincon, fminimax, fseminf, linprog, lsqlin, quadprog
Aeq, beq
The matrix Aeq and vector beq are, respectively, the coefficients of the linear equality constraints and the corresponding right-hand side vector: .
fgoalattain, fmincon, fminimax, fseminf, linprog, lsqlin, quadprog
C, d
The matrix C and vector d are, respectively, the coefficients of the over- or under-determined linear system and the right-hand-side vector to be solved.
lsqlin, lsqnonneg
f
The vector of coefficients for the linear term in the linear equation f'*x or the quadratic equation x'*H*x+f'*x.
linprog, quadprog
fun
The function to be optimized. fun is a function or an inline object. See the individual function reference pages for more information on fun.
fgoalattain, fminbnd, fmincon, fminimax, fminsearch, fminunc, fseminf, fsolve, fzero, lsqcurvefit, lsqnonlin
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. Unbounded variables may also be specified using -Inf (for lower bounds) or Inf (for upper bounds). For example, if lb(i) = -Inf then the variable x(i) is unbounded below.
fgoalattain, fmincon, fminimax, fseminf, linprog, lsqcurvefit, lsqlin, lsqnonlin, quadprog
nonlcon
The function that computes the nonlinear inequality and equality constraints. See the individual reference pages for more information on nonlcon.
fgoalattain, fmincon, fminimax
ntheta
The number of semi-infinite constraints.
fseminf
options
An optimization options parameter structure that defines parameters used by the optimization functions. For information about the parameters, see Table 4-3, Optimization Options Parameters or the individual function reference pages.
All functions
P1, P2,...

Additional arguments to be passed to fun, nonlcon (if it exists), and seminfcon (if it exists), when the optimization function calls the functions fun, nonlcon, or seminfcon using these calls:
    f = feval(fun,x,P1,P2,...)
    [c, ceq] = feval(nonlcon,x,P1,P2,...)
    [c,ceq,K1,K2,...,Kn,s]= ... 
            feval(seminfcon,x,s,P1,P2,...)
    
fgoalattain, fminbnd, fmincon, fminimax, fminsearch, fminunc, fseminf, fsolve, fzero, lsqcurvefit, lsqnonlin

Using this feature, the same fun (or nonlcon or seminfcon) can solve a number of similar problems with different parameters, avoiding the need to use global variables.

seminfcon
The function that computes the nonlinear inequality and equality constraints and the semi-infinite constraints. seminfcon is the name of an M-file or MEX-file. See the individual function reference pages for fseminf more information on seminfcon.
fseminf
weight
A weighting vector to control the relative under-attainment or over-attainment of the objectives.
fgoalattain
xdata, ydata
The input data xdata and the observed output data ydata that is to be fit to an equation.
lsqcurvefit
x0
Starting point (a scalar, vector or matrix).
(For fzero, x0 can also be a two-element vector representing an interval that is known to contain a zero.)
All functions except fminbnd
x1, x2
The interval over which the function is minimized.
fminbnd

Table 4-2: Output Arguments 
Argument
Description
Used by Functions
attainfactor
The attainment factor at the solution x.
fgoalattain
exitflag
The exit condition. For the meaning of a particular value, see the function reference pages.
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.
fmincon, fminunc
hessian
The value of the Hessian of fun at the solution x.
fmincon, fminunc
jacobian
The value of the Jacobian of fun at the solution x.
lsqcurvefit, lsqnonlin, fsolve
lambda
The Lagrange multipliers at the solution x. 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. 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 the optimization routine was at when it terminated prematurely.
All functions


 Function Reference Optimization Options Parameters