I have encountered this problem while writing an optimization problem in which the MSE function is called to calculate the mean square error, I would like to ask what is the reason for this error? Thanks!!!

optimization problem:

function [P,f] = update_P(para, c, P, Z, w, g_MMSE,rho)

%Update P using cvx toolbox

% [P,f] = update_P_Rq(para, rho, c, P, Z, w, g_MMSE)

%Inputs:

% para: structure of the initial parameters

% c: equivalent communication channel

% P: beamformer at BS

% a: steering vector

% Z: a positive semidefinite matrix

% w: weight of MSE

% g_MMSE: MMSE receiver

%Outputs:

% P: updated P

% f: optimal value of objective function

cvx_begin

```
variable P(para.M,para.K) complex
%objective function
f = objective_func(para, w, c, P, g_MMSE, Z,rho);
minimize(f);
subject to
%constrant
```

norm(P,‘fro’) <= para.Pt;

cvx_end

end

%objective function

function [f] = objective_func(para, w, c, P, g_MMSE, Z,rho)

```
term_1 = w'*MSE(para, c, P, g_MMSE);
term_2 = 0;
for k = 1:para.K
pk = P(:,k);
term_2 = term_2 + pk'* Z *pk;
end
f = rho*term_1 + term_2;
```

end

MSE function:

function [e] = MSE(para, c, P, g)

%The Mean Square Error at the MMSE receiber

% [e] = MSE(para, c, r, P, Rq)

%Inputs:

% para: structure of the initial parameters

% c: equivalent communication channel

% P: beamformer at BS

% g: MMSE receiver

%Outputs:

% e: mean square error

% MSE at the MMSE receiver

e = zeros(para.K,1);

for k = 1:para.K

pk = P(:,k);

ck = c(:,k);

gk = g(k);

```
e(k) = pow_abs(gk, 2) * ( sum(pow_abs(ck'*P,2)) + para.n )...
- 2*real( gk*ck'*pk ) + 1;
```

end

end