# "Invalid quadratic form(s): not a square."

Hi, everyone.I have problem to solve the following question.

Here is the code:

``````L = 3,K = 4;v = 2;eta = 1;sigmma = 10^-6;Q0 = 1,SINR0 = 10,M = 128;
b = beta(L,K,v);
cvx_begin sdp
variable p(L,K)
variable rho(L,K)
expression interference(L,K)
expression interference_all(L,K)
for j = 1:L
for k = 1:K
for l=1:L
for i=1:K
interference_all(l,i) = p(l,i)*b(j,l,k);
end
end
interference(j,k) = sum(sum(interference_all))-p(j,k)*b(j,j,k);
end
end

minimize sum(sum(p))

subject to
for j = 1:L
for k = 1:L
rho(j,k)>0;
rho(j,k)<1;
p(j,k)>0;
eta*(1-rho(j,k))*(M*p(j,k)*b(j,j,k)+interference(j,k)+sigmma)>=Q0;
rho(j,k)*p(j,k)*M*b(j,j,k)>=SINR0*(rho(j,k)*interference(j,k)+rho(j,k)*sigmma+sigmma)
end
end
cvx_end
``````

And here is the error

``````
`error using times>times_q (line 84)
Disciplined convex programming error:
Invalid quadratic form(s): not a square.

error cvx_binary_op (line 107)

error  .*  (line 53)

error  *  (line 35)

error ps3 (line 36)
rho(j,k)*p(j,k)*M*b(j,j,k)>=SINR0*(rho(j,k)*interference(j,k)+rho(j,k)*sigmma+sigmma)
``````

You are multiplying `rho` and `p` (directly, and via interference, which is an affine function of `p`), which is non-convex.
Are you sure `rho` is supposed to be a CVX optimization) variable? If `rho` were input data, i.e., a MATLAB variable, not a CVX variable, then this would be convex, actually a Linear Program, and would be accepted by CVX.