# Illegal operation: {complex constant} - {convex}

(lxq) #1
``````  R=[0.05,-0.00046 + 0.04999i,0.049 + 0.002i,-0.002 + 0.049i;-0.0004 - 0.049i,0.05,0.0017 - 0.049i,0.0499 + 0.002i;0.049 - 0.002i,0.001 + 0.0497i,0.05,-0.0004 + 0.049i;-0.0026 - 0.04992i,0.0499 - 0.0022i,-0.000463 - 0.049997i,0.05]
e = ones(8,1);
d1=1;
d2=0.5;
alpha=[22.5,45,67.5,90,112.5,135,157.5,180];
beta=[10,40,315,345,10,40,315,345];
cvx_begin
variable h_1(1,8)
minimize  norm(R-sum_square_abs([h11,sum(h_1.*exp(-1j*2*pi*d1*alpha)),sum(h_1.*exp(-1j*2*pi*d2*beta)),sum(h_1.*exp(-1j*2*pi*d1*alpha)+h_1.*exp(-1j*2*pi*d2*beta))]), 2)
subject to
h_1 * e == 1;
cvx_end``````

(Mark L. Stone) #2

I have no idea what you’re trying to do, but it certainly is not compliant with CVX’s DCP rules.

Have you shown the objective function s convex? If so, how did you do so?

(lxq) #4

You mean it may not be a convex problem?

(Mark L. Stone) #5

You have to show that it is.

Do you really intend to minimize the matrix 2-norm (of a matrix minus s scalar)?