How to solve the problem of variable NaN?

Hello,
the first two days of debugging cvx finally passed the code, but now there are new problems : the value of the variable is NaN.
Where might this be wrong ? How do I need to modify it ?Please help me

Here ’ s my code:

close all
clc;
clear all;
%**************参数设置*************%
K=2;%用户数量
T=1;%总时间周期
M=6;%发射天线数
N=30;%反射元件数
chi=0.8;%能量转换效率
PkC=0.005;%7dbm
Pe=0.0015;%1.8dbm
PPS=0.05;%17dbm
PIR=0.05;%17dbm
delta=10^(-6);%delta^2=-80dbm
Pmax=0.316;%25dbm
Rkmin=0.5;%bits/Hz
% Imax=10^5;%迭代次数
% Lmax=10^5;%迭代次数
% epsilon=10^-5;%允许误差
d0=10;%PS到RIS距离
d1=60;%RIS到IR距离

d01=sqrt(85);%能量站PB到RIS的距离
d02=sqrt(104);%能量站PB到WD2的距离
d11=sqrt(5);%RIS到WD1的距离
d12=2;%RIS到WD2的距离
d21=59;%WD1到信息接收机IR的距离
d22=58;%WD2到信息接收机IR的距离

% H = rice_matrix1(M,N);%30*6维
% G = rice_matrix2(M,N);%30*1维
H=abs(randn(30,6)*d0.^(-2));
h=randn(30,1);
% H1 = abs(real(H)*d0.^(-2));%30*6
% H2 = abs(real(H)*d02.^(-2));%30*6
h1 = abs(real(h)*d11.^(-2));%30*1
h2 = abs(real(h)*d12.^(-2));%30*1
G1=h1'*H;%1*6
G2=h2'*H;%1*6
% h(1)=d01^(-2);%PT到ST1之间的信道增益
% h(2)=d02^(-2);%PT到ST2之间的信道增益
g(1)=d21^(-2);%WD1到IR之间的信道增益
g(2)=d22^(-2);%WD2到IR之间的信道增益

% H1(1)=h1.*H;%PS到RIS之间的信道增益
% H1(2)=h2.*H;%PS到RIS之间的信道增益
% G1=g(1).*G;%ST1到SR1之间的信道增益
% G2=g(1).*G;%ST2到SR2之间的信道增益


 opt_q1=[];
% opt_q2=[];
% opt_q3=[];
 q1=10;
% q2=10;
% q3=20;

% gama=0.05;%Rn_h的中断概率
% rou=0.05;%Rn_b的中断概率
% delta_h=0.005;%Δhk的界
% delta_g=0.005;%Δgk的界

for l = 1:1:10
eta= 0.01;
%     for k=1:K 
%     h_(1,k)=(4*delta_h*delta_g*rou+2*g(k)*delta_h-2*delta_h*delta_g)/log((h(k)+delta_h)/(h(k)-                delta_h));
%     g_(1,k)=g(k)+2*gama*delta_g-delta_g;
%    end

%********子问题1*********
    cvx_solver Mosek
 cvx_begin
    variable   W_W(M,M)  semidefinite
    variables   t0 t(K,1) p_p(K,1);
    expressions R1(1,K) R2(1,K)
%     R2(K,1) R3(K,1) R4(K,1) R5(K,1)
    for k=1:K  
        %R1(k,1)=t(k,1)*log(1+p_p(k,1)*g(k)^2/(t(k,1)*delta^2))/log(2);
        R1(1,K)=-rel_entr(t(k,1),p_p(k,1)*g(k)^2/delta^2+t(k,1));
        %y=t(k,1),x=p_p(k,1)*g(k)^2/delta^2;
    end
%     for k=1:K
%         R2(k,1)=p_p(k,1);
%         R3(k,1)=(t0+t(k,1))*PkC;
%         R4(k,1)=t(k,1)*PIR;        
%     end 
        R2(1,1)=chi*(G1*W_W(M,M)*G1');
    R2(1,2)=chi*(G2*W_W(M,M)*G2');
maximize sum(R1)-eta*(sum(p_p)+t0*(PPS+N*Pe)+t0*PkC+sum(t(k,1))*PkC+sum(t(k,1))*PIR+trace(W_W(M,M))-sum(R2));
subject to
  t0+sum(t)<=T;
  t0>=0;
  trace(W_W(M,M))<=t0*Pmax;
   p_p(1,1)+PkC*(t0+t(1,1))<=chi*(G1*W_W(M,M)*G1');
    p_p(2,1)+PkC*(t0+t(2,1))<=chi*(G1*W_W(M,M)*G1');
  for k=1:K
    t(k,1)>=0;
   
    R1(1,k)>=Rkmin;  
  end
  
cvx_end

work area shows:

The problems are reported to be infeasible (for l = 1, 2, 3, which I tried), as you would know if you looked at the solver and CVX output, which you should always do.

All but section 1 of https://yalmip.github.io/debugginginfeasible also applies to CVX.

I needed to use parentheses around the argument of maximize, and got an error message when I tried to run your code without doing that. I think that is needed when there is more than one term in maximize or minimize.