Invalid quadratic form: product is complex

when I try the following program,I came across with the following problems

cvx_begin
variable w_x(n,1) complex;
     aaa=w_x'*Rx*w_x;  
     minimize(aaa+norm(w_x'*a_x,1));
subject to 
     w_x'*steer==1;
cvx_end
cvx_status

Error using ==> cvx.mtimes at 258
Disciplined convex programming error:
Invalid quadratic form: product is complex.

Error in ==> Capon_beamforming at 37
aaa=max(abs(w_x’Rxw_x));
I am new to cvx,please help me out!!!

Considering that you are dealing with a beamforming problem, maybe you are interested in minimize “abs(aaa)” or “norm(aaa)” instead of the complex value directly.

Is R_x hermitian?

If R_x is hermitian, how to deal with it? THX :blush:

In that case, w_x'*Rx*w_x is supposed to be real, but it won’t be due to floating-point roundoff error. So just replace it with real(w_x'*Rx*w_x).

1 Like

Thank you very much!!:grinning:

Hi all, did you get the solution following the Michael’s answer ? I got the same error but when I tried with Real, it doesn’t work.

So do I! Did you solve it?