for iter =1: 20
cvx_begin
variable w(M*N,1) complex
x=g_vec'*w;
y_=alpha*q^2*abs(f_vec'*w_vec_in)^2+noise;
y =alpha*q^2*abs(f_vec'*w)^2+noise;
x_=g_vec'*w_vec_in;
maximize 1/log(2)*(log(1+abs(x_)^2/y_)+2*abs(x_'*x)/y_-abs(x_)^2/y_-(abs(x_)^2*(y+abs(x)^2))/(y_*(y_+abs(x_)^2)))
%
subject to
real(f_vec'*w_vec_in)^2+2*real(f_vec'*w_vec_in*f_vec'*(w-w_vec_in)) >=(gamma_th_psr*noise)/(alpha*q^2);%
for m=1:M
norm (w(1+(m-1)*4:4*m))<=p_m(m);
end
cvx_end
obj(iter)=cvx_optval;
w_vec_in=w;
end
I have the following error:
y =alpha*q^2*abs(f_vec'*w)^2+noise;
Disciplined convex programming error:
Illegal operation: {convex} .^ {2}
(Consider POW_P, POW_POS, or POW_ABS instead.)