%declare
K=4;
N=4;
L=5;%distance between RX & TX
nois_var_hk_2pow=0.1*(L^(-2.05))
nois_var_ak_2pow=[10^-10 10^-10 10^-10 10^-10 ];
nois_var_dk_2pow=[10^-8 10^-8 10^-8 10^-8 ];
bar_r=[10 10 10 10];
P_T=10;
h_1=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_2=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_3=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_4=sqrt(nois_var_hk_2pow/2)*(randn(N,1)+1i*randn(N,1));
h_kk=cat(2,h_1 ,h_2 ,h_3, h_4)
for n=1:4
h_k{n}=h_kk(1:4 , n);
n=n+1;
end
%===========================================================
cvx_begin
variable FNNK(N,N,K) semidefinite;
Fkk=cat(2,FNNK);
u=0
for o=1:4
Fk{o}=Fkk(1:4,o+3*u:4*o)
u=u+1;
end
op2=0;
for k=1:K
op2=op2+FNNK(k)
end
%==========================================
%objected function
minimize( op2 )
subject to
%==========================================
%c8
total = 0;
for k = 1:K
sumja = 0;
for j = 1:K
if j ~= k
sumja = sumja + h_k{k}' * Fk{j} * h_k{k};
end
end
total = total + sumja;
end
numerator=real(h_k{k}' * Fk{k} * h_k{k})
denominator=inv_pos(real(total)+nois_var_ak_2pow(1) + nois_var_dk_2pow(1))
numerator*denominator>=bar_r(1)
cvx_end
My problem is the last 3 line code (not including cvx_end), the numerator , denominator and bar_r(1) are all a value,and the window said
1.Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {real affine} .* {convex}
2.Error in f_kI (line 56)
numerator*denominator>=bar_r(1)
I don’t understand the error window said,because in numerator*denominator>=bar_r(1)
this line,i didn’t
use the .* ,besides,both numerator and denominator are scalar(value),i don’t need to use .*