The function 'cos' is not defined for an input of type 'cvx'.how can I fix it?

cvx_begin
variable theta_opt(M,Omax)
variable omega_opt
for n=1:N %时隙
for k=1:K %用户个数24个
%用户
aa = cos(omega_opt) + 1isin(omega_opt);
grkH_bigphi_gur((n-1)K+k) = rho0M
(cos(omega_opt) + 1isin(omega_opt))/sqrt(drk(k).^2dur(n).^2);
%干扰机
C=0;
for i=1:M
theta_opt(n,i)=2*(i-1)pi/lambdad*(phi_rk(n)-phi_ur(n))+omega_opt;
C = C + cos(theta_opt(n, i) + 1isin(theta_opt(n, i) + 2(i-1)pi/lambdad*(phi_re(n)-phi_ur(n))));
end
greH_bigphi_gur(n)=C/sqrt(dre(n).^2dur(n).^2);
end
%约束
ggre=greH_bigphi_gur(n).^2;
ggd=rho0.^2
M.^2/sqrt(dre(n).^2*dur(n).^2);
subject to
ggre<=ggd
end
cvx_end

Writing exp(1i*omega_opt) from your previous topic “Disciplined convex programming error: Illegal operation: exp( {affine} ).”how can I fix it?
as cos(omega_opt) + 1i*sin(omega_opt) doesn’t make it any more convex or concave, or acceptable to CVX. Actually it’s even “less acceptable” to CVX in the sense that neither sin nor cos are supported in CVX, even for real affine expressions.

Perhaps you need to carefully re-read the link provided in my answer to your previous topic.