```
function [p,r,Vk] = MaxSumRate_CVX(h,No,P_max,K,J,Nt,Nr)
% Maximizing system sum rate using CVX
cvx_begin
cvx_solver mosek
variable p(K,J) nonnegative % The power of each sub message
variable Vk(Nt,J) complex % The digital precoding metrix
dual variables w u
expressions r(K,J) h_gain(K,J) SINR(K,J)
h_gain = []; % Channel gain
for k=1:K
gain{k} = sum(pow_abs(h{k}*Vk,2));
h_gain = [h_gain; gain{k}];
end
SINR = (p.*h_gain)./No; % Calculate SINR
for k=1:K
for j=1:J
r(k,j) = log(SINR(k,j) + 1) ./ log(2);
end
end
maximize sum(r(:))
subject to
w:sum(p(:)) <= P_max;
w:sum(p,1) <= P_max/K;
u:square_pos(norm(Fk)) <= 1;
cvx_end
end
```

Disciplined convex programming error:

Cannot perform the operation: {real affine} .* {convex}

出错 MaxSumRate_CVX (第 14 行)

SINR = (p.*h_gain)./No; % Calculate SINR

I don’t know how to solve it.