| Optimization Toolbox™ | ![]() |
| On this page… |
|---|
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. | bintprog, 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-side vector: Aeq*x = beq. | bintprog, fgoalattain, fmincon, fminimax, fseminf, linprog, lsqlin, quadprog |
| 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 a function handle for an M-file function or a function handle for an anonymous function. 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. | |
| H | The matrix of coefficients for the quadratic terms in the quadratic equation x'*H*x+f'*x. H must be symmetric. | |
| 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. | fgoalattain, fmincon, fminimax, fseminf, linprog, lsqcurvefit, lsqlin, lsqnonlin, quadprog |
| 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. | |
| options | An structure that defines options used by the optimization functions. For information about the options, see Optimization Options 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 an M-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. | |
| weight | A weighting vector to control the relative underattainment or overattainment of the objectives. | |
| xdata, ydata | The input data xdata and the observed output data ydata that are to be fitted to an equation. | |
| 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. |
Output Arguments
| Argument | Description | Used by Functions |
|---|---|---|
| attainfactor | The attainment factor at the solution x. | |
| exitflag | An integer identifying the reason the optimization algorithm terminated. See the function reference pages for descriptions of exitflag specific to each function. 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. | bintprog, 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. | |
| 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 medium-scale methods, hessian is the value of the Quasi-Newton approximation to the Hessian at the solution x. | |
| 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. 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. | |
| 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. | |
| 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 |
![]() | Argument and Options Reference | Optimization Options | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |