y = updateY(K,J,Nr,Ns,h_eff,noise,decodingorder,VBB); % Calculate the optimal value of auxiliary variable ym
% Using CVX to solve convex optimization problems for optimizing power allocation {pkj}
cvx_begin quiet
cvx_solver mosek
variable VBB(Nrf, Ns, K, J) complex % The power of each sub message
expressions fq_r(K,J) interference(Nr,Nr,K,J)% The rate of each sub message and user interference
for k = 1:K
for j = 1:J
[row,col] = find(decodingorder>decodingorder(k,j)); % Identify data streams that decoding order greater as interference
% Calculate interference on the (k, j) th data stream
for l = 1:length(col)
interference(:,:,k,j) = interference(:,:,k,j) + square_pos(norm(h_eff(:,:,row(l)) * VBB(:,:,row(l),col(l))));
% h_eff(:,:,row(l)) * VBB(:,:,row(l),col(l)) * VBB(:,:,row(l),col(l))’ * h_eff(:,:,row(l))';
end
% Calculate the equivalent rate of the (k, j) th data stream
fq_r(k,j) = log_det(eye(Ns) + 2*real(y(:,:,k,j)'*h_eff(:,:,k)*VBB(:,:,k,j))...
-y(:,:,k,j)'*(interference(:,:,k,j) + noise*eye(Nr))*y(:,:,k,j)) ./ log(2);
norm(VRF(:,:,k)*VBB(:,:,k,j)) <= sqrt(pkj_max(k,j));
sum(sum_square_abs(VBB(:,:,k,j))) <= pkj_max(k,j);
end
end
maximize sum(fq_r(:)) % objective function Q_sumrate
subject to
fq_r >= r_min; % Minimum data stream rate requirement
cvx_end
There is a erro:
错误使用 &
操作数必须为实数。
出错 cvx/cvx_vexity (第 38 行)
v( any( imag( x.basis_ ), 1 ) & v ) = NaN;
出错 * (第 296 行)
v = cvx_vexity( z );
出错 get_VBB_runFP (第 66 行)
-y(:,:,k,j)'(interference(:,:,k,j) + noiseeye(Nr))*y(:,:,k,j)) ./ log(2);
Perhaps CVX does not support matrix multiplication like A '* B * A. Is there any other equivalent conversion method that CVX can handle?