I’m new in cvx. When i use cvx,it says"Cannot perform the operation: {invalid} .* {real affine}"

What should i do ?

Here is my code:

```
VS = rand(M,K);
cvx_begin sdp
cvx_solver Mosek
variable P(Nu,Nu,U) nonnegative
expression object;
object = cvxobject_monte(K,U,M,Nu,W_cu,W_s,W_BS,xi,P,eta_old,HH_freq,VS,Cw);
maximize object
subject to
for u =1:U
sum(diag(P(:,:,u))) <= Pmax;
end
P>=0;
cvx_end
```

where:

function [ object ] = cvxobject_monte(K,U,M,Nu,W_cu,W_s,W_BS,xi,P,eta_old,HH_freq,VS,Cw)

```
Ur = dftmtx(M)/sqrt(M);
Ut = dftmtx(Nu)/sqrt(Nu);
A=zeros(K,K);
for u =1:U
HH_freq(:,:,1,1,u) = Ur*HH_freq(:,:,1,1,u)*Ut';
A = A + VS'*Cw^(-1/2)*HH_freq(:,:,1,1,u)*P(:,:,u)*HH_freq(:,:,1,1,u)'*Cw^(-1/2)*VS;
end
Rs = real(log_det(eye(K)+A));
W_sum = 0;
for u = 1:U
W_sum = W_sum + xi*sum(diag(P(:,:,u)))+ W_cu;
end
W_sum = W_sum + K*W_s + W_BS;
object =Rs - eta_old*W_sum;
```

end

Status: Infeasible

Optimal value (cvx_optval): -Inf

wrong use .* (line 173)

Disciplined convex programming error:

Cannot perform the operation: {invalid} .* {real affine}

wrong * (line 36)

z = feval( oper, x, y );

wrong cvxobject_monte (line 32)

object =Rs - eta_old*W_sum;

wrong: Copy_of_DMA_EE_montecalor (line 75)

object = cvxobject_monte(K,U,M,Nu,W_cu,W_s,W_BS,xi,P,eta_old,HH_freq,Q_OD,Cw);