how to rectify this error Error using .* (line 262) Disciplined convex programming error: Invalid quadratic form(s): not a square. Error in * (line 36) z = feval( oper, x, y ); Error in itcm_31 (line 20) f(p,p)=(log2(1+(alpha_o
12 次查看(过去 30 天)
显示 更早的评论
if true
H1=[0.4232 0;0 0.5345];
H2=[0.35477 0;0 0.423];
Q1e=[0.1 0;0 0.14332];
Q2e=[0.4 0;0 0.001];
QR1e=[0.2 0;0 0.004];
P1_max=1;P2_max=1;PR_max=1;
sigma_1=0.2;sigma_2=0.2;sigma_D=0.2;sigma_R=0.2;
P1_ct=0.5;P1_cr=0.5;
Pc=3;
Rt_min=1;
cvx_begin
variable alpha_opt(1) nonnegative
variable Q1e(2,2)
variable Q2e(2,2)
variable QR1e(2,2)
dual variables A B
for p=1:2
f(p,p)=(log2(1+(alpha_opt.*QR1e(p,p)*Q2e(p,p)*H1e(p,p)*H2e(p,p))/(sigma_D+alpha_opt.*sigma_1+alpha_opt.*sigma_R*QR1e(p,p)*H1e(p,p)))+log2(1+(QR1e(p,p)*Q1e(p,p)*H1e(p,p)*H2e(p,p))/(sigma_2+sigma_R.*QR1e(p,p)*H2e(p,p))));
g(p,p)=(Q1e(p,p)+QR1e(p,p)*Q2e(p,p)*H2e(p,p)+Q1e(p,p)*H1e(p,p)+sigma_R)+Q2e(p,p)+Pc;
end
minimize(f/g)
subject to
A: trace(Q1e)>=0;
B: trace(Q2e)>=0;
cvx_end
end
1 个评论
Jan
2018-5-31
The code is not readable. Please use the "{} Code" button to format it.
clc; clear all; close all; warning off; is a really brute header. It is waste of time to remove all loaded functions from the memory by clear all and counterproductive to disable all warnings: Fix the reasons of warnings instead of ignoring the messages.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!