I am a new CVX learner.I don’t know what is wrong with my code to solve a QP problem
H=[1,0,-1,0;0,1,0,-1;-1,0,1,0;0,-1,0,1];
A=[-1,0,0,0;0,-1,0,0;1,2,0,0;0,0,0,-1;0,0,-1,-1;0,0,1,2];
b=[0,0,2,-2,-3,6];
cvx_begin
variable x(4);
minimize(x'*H*x);
subject to
A*x <= b;
cvx_end
It reports errors:
Error using cvxprob/newcnstr (line 87)
Matrix dimensions must agree.
Error in cvx/le (line 21)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘<=’ );