% two-variable convex QP H = 2*eye(2); A = [1 4; 3 7]; b = [5 9]; f = [-3 -2.5]; Aeq = [ ]; beq = []; lb = [0 0]; ub = [inf inf]; x0=[]; options = optimset('LargeScale', 'off'); [x,fval,exitflag,output] = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options)