% Syntax: osc_example_qp_1

H=[2 -1 0 0; -1 1 1 0; 0 1 4 2; 0 0 2 4]
c=[0 -3 -2 0]'
A=[2 1 0 0;0 2 1 2]
b=[4 4]'
lb=[0 0 0 0]'
ub=[Inf Inf Inf Inf]'
x0=zeros(4,1)

options=optimoptions('quadprog','Algorithm','active-set');
           % Select the active-set algorithm

x=quadprog(H,c,[],[],A,b,lb,ub,x0,options)
