FUNCTION REFERENCE
quadprog
Minimize a convex quadratic objective with linear constraints.
Minimize a convex quadratic objective with linear constraints.
Syntax
[x, fval, exitflag, output, lambda] = quadprog(H, f, A, b, Aeq, beq, lb, ub, x0, options)Syntax
x = quadprog(problem)Minimizes 0.5*x'*H*x + f'*x. The short form quadprog(H,f) is valid;
empty f means zero linear objective. H is symmetrised; its smallest eigenvalue
must be at least -1e-10*max(1,norm(H)). Singular positive semidefinite H is legal.
Uses a regularised primal-dual interior-point QP method with predictor-corrector
steps. Options can
occupy the x0 slot when x0 is omitted. Problem fields: H,f,Aineq,bineq,Aeq,beq,
lb,ub,x0,options. Linear constraints, outputs, limits and multiplier signs follow
linprog, including its SciPy sign table. QP infeasibility uses a feasibility
phase and unboundedness uses a checked zero-curvature recession direction.
For infeasible (-2) or unbounded (-3) problems, x and fval are [], and all
lambda fields are []. A failed solve without a finite feasible iterate also
returns these empty outputs; a feasible iterate is retained at an iteration limit.
SciPy signs: negate linprog ineqlin/eqlin/upper marginals; keep lower.
For SLSQP constraints -g >= 0 keep inequality multipliers; negate equality
multipliers for h = 0. All MatRust inequality multipliers are nonnegative.
Differences from MATLAB: dense convex real problems only. There is no simplex;
algorithm names map to the primal-dual implementation. No sparse factorisation.
Example
[x,f] = quadprog(2*eye(2),[-2;-4],[1 1],2)Example
x=quadprog(eye(2),[])These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.