I am a new learner in CVX. Recently, I have found some diffiulties in long and complex expressions.The code is as follows. I need to get the minimize number of xi_TR_D and the variable P is a matrix.

```
while diffR > threshold
n = n+1;
cvx_begin quiet
variable p(3,3) complex;
variable X_CD_C;
[power_T,X_CD_C,X_CD_D,xi_D_D,xi_C,r_0,xi_CD_D,xi_CD_C] = get_xi_TR_D(p, X_CD_C,beta_0,rho,h_TC,h_C,h_D,eta,power_B,h_BT,sigma_T,sigma_C,sigma_D,r_0);
minimize xi_TR_D;
subject to
X_CD_C+X_CD_D+1 >= xi_CD_D;
X_CD_D+X_CD_C+1 >= xi_CD_C;
sum_square_abs(p(:)) <= power_T;
X_CD_C <= 0;
X_CD_D <= 0;
cvx_end
optimal_solution = xi_TR_D;
fprintf('Optimal Solution (x): %f\n', optimal_solution);
disp(n);
end
function [power_T,X_CD_C,X_CD_D,xi_D_D,xi_C,r_0,xi_CD_D,xi_CD_C] = get_xi_TR_D(p, X_CD_C,beta_0,rho,h_TC,h_C,h_D,eta,power_B,h_BT,sigma_T,sigma_C,sigma_D,r_0)
power_T = beta_0*rho*eta*(power_B*abs(h_BT)+sigma_T^2)/(1-beta_0);
SINR_BT_C = (1-r_0)*power_B*det(h_BT)^2/sigma_T^2;
SINR_CD_C = (det(transpose(h_TC) * p(:,1))^2 * power_T) / ((det(transpose(h_C) * p(:,2))^2 * power_T) + (det(transpose(h_C) * p(:,3))^2 * power_T) + sigma_C^2);%C_CD的信噪比
SINR_CD_D = (det(transpose(h_TR) * p(:,1))^2 * power_T) / ((det(transpose(h_D) * p(:,2))^2 * power_T) + (det(transpose(h_D) * p(:,3))^2 * power_T) + sigma_D^2);%D_CD的信噪比
SINR_C_C = (det(transpose(h_TC) * p(:,2))^2 * power_T) / ((det(transpose(h_TC) * p(:,3))^2 * power_T)+sigma_C^2);
SINR_D_D = (det(transpose(h_TR) * p(:,3))^2 * power_T) / ((det(transpose(h_TR) * p(:,2))^2 * power_T)+sigma_D^2);
R_BT_C = beta_0 * log2(1 + SINR_BT_C);%BS到DTU的速率
R_CD_D = (1-beta_0) * log2(1+SINR_CD_C);%DTU发送给DRU的公共流速率
R_CD_C = (1-beta_0) * log2(1+SINR_CD_D);%DTU发送给CU的公共流速率
R_D_D = (1-beta_0) * log2(1+SINR_C_C);%DTU到DRU的私有流速率
R_C_C = (1-beta_0) * log2(1+SINR_C_C);%DTU到CU的私有流速率
R_TR_D = R_D_D + R_CD_D;%DTU到DRU的总速率
R_TC_C = R_C_C + R_CD_C;%DTU到CU的总速率
R_CD = min(R_CD_C,R_CD_D);
X_CD_D = -R_CD- X_CD_C;
xi_CD_D = 1 - C_CD_D;
xi_CD_C = 1 - C_CD_C;
xi_C_C = 1 - R_C_C;
xi_D_D = 1 - R_D_D;
xi_TR_D = xi_CD_D + xi_D_D;
xi_C = xi_CD_C + xi_C_C;
end
```