# 用的是mosek求解器，CVX报错：超出数组索引，

for l1=1:L1
B1r(:,:,l1)=lamda_breye(M)-h_be_rW_rh_be_r’;
B2r(:,:,l1)=-h_be_r
W_rh_be_r’H_ie_r(:,l1);
B3r(:,:,l1)=-H_ie_r(:,l1)'h_be_rW_r
h_be_r’;
B4r(:,l1)=-lamda_br
S_be^(2)-…
H_ie_r(:,l1)‘h_be_rW_r*h_be_r’*H_ie_r(:,l1)+chi_br(l1) ;
A_br(:,:,l1)=[B1r(:,:,l1),B2r(:,:,l1);B3r(:,:,l1),B4r(:,l1)];

            Gamma_wr=trace(Wrx*(H_ie_r(:,l1)*H_ie_r(:,l1)'+S_be^(2)*eye(M)+...
2*S_be*sqrt(eye(M)*(H_ie_r(:,l1)'*Wrx*H_true_br(:,l1))/trace(Wrx))));

J1r(:,:,l1)=lamda_jr*eye(M)+h_je_r*F_f*h_je_r';
J2r(:,:,l1)=h_je_r*F_f*h_je_r'*H_ie_r(:,l1);
J3r(:,:,l1)=H_ie_r(:,l1)'*h_je_r*F_f*h_je_r';
J4r(:,l1)=-lamda_jr*S_je^(2)+...
H_ie_r(:,l1)'*h_je_r*F_f*h_je_r'*H_ie_r(:,l1)-chi_jr(l1) ;
A_jr(:,:,l1)=[J1r(:,:,l1),J2r(:,:,l1);J3r(:,:,l1),J4r(:,l1)];

Gamma_fr=trace(Frx*(H_ie_r(:,l1)*H_ie_r(:,l1)'+S_je^(2)*eye(M)-...
2*S_je*sqrt(eye(M)*(H_ie_r(:,l1)'*Frx*H_true_jr(:,l1))/trace(Frx))));
t1=(Gamma_wr+Gamma_fr+a0)^(-1);
Pha2_r(:,l1)=real(t1*(chi_br(l1)+chi_jr(l1)+a0)-log(t1)-1)-log_det(real(chi_br(l1)+a0));
end


。。。。。。
maximize B/log(2)(nr(Pha1_r-x1))+…
B/log(2)(nt(Pha1_t-x2))
subject to
x1>=0;
x2>=0;
real(trace(W_r+W_t))<=P1_max(ll);
real(trace(F_f))<=Pn;
for l1=1:L1
Pha2_r(:,l1)<=x1;
A_br(:,:,l1) == hermitian_semidefinite(M+1);
A_jr(:,:,l1) == hermitian_semidefinite(M+1);
end
for l2=1:L2
Pha2_t(:,l2)<=x2;
A_bt(:,:,l2) == hermitian_semidefinite(M+1);
A_jt(:,:,l2) == hermitian_semidefinite(M+1);
end
cvx_end[quote=“Zigurta, post:1, topic:11590, full:true”]
Hi
I have a problem with my optimization program. I have created a simple explanation for you, which I have attached.
\min\limits_{p_1,p_2} trace ((P^{\frac{-T}{2}}{k|k-1}W_kP^{-\frac{1}{2}}{k|k-1}+C^{T}{k}(R^{\frac{-T}{2}}{k}S_kR^{-\frac{1}{2}}{k})C{k})^{-1})\
{subject~to}~ \
1=<p_1<2\
1=<p_2<2\
where W_k and S_k are diagonal matrices such that
W_k=diag(\frac{|e_k|^{p_1}+\sigma^2}{e_k^2+\sigma^2})\
S_k=diag(\frac{|f_k|^{p_2}+\sigma^2}{f_k^2+\sigma^2})\
e_k and f_k are known and ranging from (-\infty,\infty), and \sigma^2 is a very small known number.
I do not know how to write W and S matrices because cvx does not support pow(a,x) when a is constant and x is variable.
I would like to ask you, if it is possible, please guide me.
[/quote]

a^x can be rewritten as exp(log(a)*x)

However, CVX will automatically do this reformulation for you, and allows you to enter a^x, where a is a positive scalar input data and x is an affine or convex expression.