Here is the problem.

And my code is below。

Ns = 4;

Nr = 16;

Lr = 5;

H = randn(Nr,Ns);

SNR_dB=10;

SNR_linear=10.^(SNR_dB/10.);

I = eye(Nr);

lower_bound = zeros(Nr,1);

upper_bound = ones(Nr,1);

cvx_begin

variable x(Nr)

C = I+SNR_linear*diag(x)* H*(H’);

maximize( log_det(real©) )

subject to

lower_bound <= x <= upper_bound;

sum(x) == Lr;

cvx_end

Matlab told me that

CVX Warning:

Models involving “log_det”……

Error using det_rootn

Error in log_det

How can I figure it out? Thank you very much.