I am using the following code to solve an OP:-

n = 16;

cvx_begin

variable y(4,4)

minimize(norm(A * y( : ) - B))

subject to:

sqrt(diag(y))*sqrt(diag(y))’ == y

cvx_end

I am getting the following error:-

Disciplined convex programming error:

Cannot perform the operation {concave}*{concave}

I think the way I have specified the constraint isn’t correct. Is there some syntax fault? (I have used this constraint so that my matrix y has rank 1.)

Thank you in advance.