If the Hessian matrix can also be computed and the Hessian parameter is 'on', i.e., options = optimset('Hessian','on'), then the function fun must return the Hessian value H, a symmetric matrix, at x in a third output argument. That is, the ith component of g is the partial derivative of f with respect to the ith component of x.
The gradient consists of the partial derivatives of f at the point x. Starts at x0 and finds a minimum x to the function described in fun subject to the linear inequalities A*x 1 % fun called with two output arguments This is generally referred to as constrained nonlinear optimization or nonlinear programming. = fmincon(.)įmincon finds a constrained minimum of a scalar function of several variables starting at an initial estimate. X = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options,P1,P2. X = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
X = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon) f(x), c(x), and ceq(x) can be nonlinear functions. Where x, b, beq, lb, and ub are vectors, A and Aeq are matrices, c(x) and ceq(x) are functions that return vectors, and f(x) is a function that returns a scalar. Fmincon (Optimization Toolbox) Optimization Toolboxįind a minimum of a constrained nonlinear multivariable function