quadprog
Quadratic programming.
📝Syntax
x = quadprog(H, f)
[x, fval, exitflag, output, lambda] = quadprog(H, f, A, b, Aeq, beq, lb, ub, x0, options)
x = quadprog(problem)
📥Input Arguments
Parameter Description
H, f quadratic and linear objective terms.
A, b, Aeq, beq linear inequality and equality constraints.
lb, ub lower and upper bounds.
📤Output Arguments
Parameter Description
x estimated solution.
fval objective value.
lambda constraint multiplier structure.
📄Description

quadprog solves dense convex quadratic programs with linear constraints and bounds using an active-set strategy.

The problem-structure form accepts H, f, Aineq or A, bineq or b, Aeq, beq, lb, ub, x0 and options. Problem-based quadratic expressions compiled by prob2struct are routed to quadprog.

💡Examples
H = [2 0; 0 2];
f = [-2; -4];
lb = [0; 0];
[x, fval] = quadprog(H, f, [], [], [], [], lb, [])
y = optimvar('y', 2, 1);
prob = optimproblem('Objective', (y(1) - 1)^2 + (y(2) + 3)^2);
[sol, fval] = solve(prob, struct('y', [0; 0]));
sol.y
🔗See Also
lsqnonnegoptimoptions
Used Functions
optimoptions prob2struct
📚Bibliography
P. E. Gill, W. Murray and M. H. Wright, Practical Optimization, Academic Press, 1981. J. Nocedal and S. J. Wright, Numerical Optimization, Springer, 2006.
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub