# How to deal with the error" Cannot perform the operation: {concave} .* {complex affine}"

There is something wrong with the code line with “T = [W * F(:,:,j), sigma * W, sigma_z * U]';
Did I correctly write the code line:”sigma_z = sqrt( (P_max - square_pos(norm(OBJ,'fro')))/(M - K));”?
How to deatl with this problem?

clear;

num_CSI = 1;
P_max = 10; % dB
P_max = 10 ^ (P_max / 10); % the true total power
M = 4; % number of relays
K = 2; % number of S-D pair
gama = 0.3; % MSE target
sigma = sqrt(0.1); % noise variance
epsilon = 0.1; % norm-bounded
j = 1;
while (j <= num_CSI)
F(:,:,j) = (randn(M,K) + sqrt(-1) * randn(M,K)) / sqrt(2); %
G(:,:,j) = (randn(M,K) + sqrt(-1) * randn(M,K)) / sqrt(2);
j = j + 1;
end
I = eye(K);
for j =1:1

[U_svd S_svd V_svd] = svd(G(:,:,j)');
U = V_svd(:,(K+1):M);

cvx_begin sdp quiet
cvx_solver sedumi
variable W(M,M) complex;
variable mu;
variable lambda(K);
expression c(2*M,1);
expression T(2*M,M);
expression sigma_z;
expression OBJ(M,M + K);

minimize(mu);  % object function
subject to
OBJ = [W * F(:,:,j), sigma * W];
sigma_z = sqrt( (P_max - square_pos(norm(OBJ,'fro')))/(M - K));%vec(OBJ)
for k = 1:K
c = [G(:,k,j)' * W * F(:,:,j) - I(k,:), sigma * G(:,k,j)' * W, zeros(1,(M-K))]';
T = [W * F(:,:,j), sigma * W, sigma_z * U]';%
[gama - sigma^2 - lambda(k), c', zeros(1,M);
c, eye(2*M,2*M), -epsilon * T;
zeros(M,1),-epsilon * T', lambda(k) * eye(M,M);] >= 0;
lambda(k) >= 0;
end
norm(OBJ,'fro') <= sqrt(mu);
cvx_end
if strfind(cvx_status,'Solved')
pow = mu
WW = W
end
end

First question: is your problem convex?

I want to get the optimal matrix W. But I am not sure whether it can be resolved.
Note that W,\mu,\lambda_{1},\ldots,\lambda_{K} are variables, others are fixed.
Is it convex or quasiconvex or nonconvex? How can I solve it? This really isn’t the right forum to ask for modeling advice, I’m afraid—this is specifically for issues with CVX. If you haven’t yet determined convexity, then you’re not a CVX user yet, because CVX is for modeling problems that you already know are convex.