What can I do about the Disciplined convex programming error?

I’m trying to solve a problem. The following is my code:
variable w nonnegative;
variable x(n,1) complex;
minimize( norm(x,1) );
subject to
W_matrix(1:m,1:m) = w;
W_matrix(num1,:slight_smile: = 1;
W_matrix = diag(diag(W_matrix));
norm(W_matrix*(y-A*x),2) <= u;
where w and x are variables, W_matrix is a diagonal matrix with 1 or w of the diagonal elements, y is a given vector with positive values, m and n is a given positive constant, num1 is a given positive array, A is a given matrix and u is a given positive value.

But it pop up this error massage:
Error using cvx/mtimes (line 126)
Disciplined convex programming error:
Only scalar quadratic forms can be specified in CVX
Error in test1w (line 71)
norm(W_matrix*(y-A*x),2) <= u;
I can’t find out why, please help me. Thank you so much.

This is non-convex, because it involves the product of optimization variables. If W_matrix were not a CVX variable or expression, it would be a convex constraint which would be accepted by CVX.

Please read Why isn't CVX accepting my model? READ THIS FIRST! .

1 Like

Thank you so much. If I want to solve this problem, what should I do or which toolbox could I use? Could you please give me some guidance?

I don’t understand what your W_matrix really is - you seem to form it in an unusual manner. If you need to optimize over W_matrix, then you need a non-convex solver. If you are content with fixing a candidate W_matrix, you can numerically assign W_matrix in MATLAB, then solve for x using CVX.

1 Like

Actually W_matrix is a diagonal weighted matrix. I will try your method. Thank you so much.