Convex programming

cvx_begin sdp
variable P(4,4) symmetric
variable R(3,2) 
variable H(1,2)
p11=P(1:3,1:3);p12=P(1:3,4);p22=P(6);
y1=p11*R+p12*H;
y2=p12'*R+p22*H;
cvx_end

R and H are known matrices with appropriate dimension. but I have following error:
Error using * (line 126)
Disciplined convex programming error:
Only scalar quadratic forms can be
specified in CVX
.

Error in cvX (line 23)
y1=p11*R+p12*H;

So what’s worng?

You are multiplying CVX variables, and not in an approved convex fashion (convex quadratic form).

You haven’t; shown what you intend to do with y1 and y2, so forum readers can’t say for sure whether your desired optimization problem, whatever that is, is convex and can be formulated consistent with CVX’s rules. But at this point, until shown evidence to the contrary, I’ll assume not.

thanks for responsibility. I got it. :slightly_smiling_face: