Hello. I am trying to solve an optimization problem to maximize the following w.r.t ‘**F**’ while the rest of the terms in the expression are ‘rand’ initializations

logdet(eye(Ns) + Hs*S*F*F’*S’*Hs’) + trace_inv(S)

I’ve rewritten the logdet expression as logdet(inv(Hs’*Hs) + S*F*F’*S’) <=> logdet(inv(H_s) + S_f),

where H_s = Hs’*Hs, S_f = S*F*F’*S’.

I am using CVX to solve the problem and since F is a variable declared in the CVX, I have that error from the title. Please help me find a solution to the problem and where I am wrong with it. Here is the code:

```
Nt = 16;
Ns = 8;
H = rand(Ns,Nt);
P = 0.1;
S = kron([1 0], eye(Ns));
H_s = (H*S')'*H*S'; % H_s = Hs'*Hs = S*H'*H*S'
cvx_begin
variable S_f(Ns,Ns) % S_f = S*F*F'*S' => Sf = S*F = chol(S_f) => F =inv(S'*S)*S'*Sf
Gmax = logdet(inv(H_s) + S_f) + trace_inv( S_f );
minimize( -Gmax)
subject to
norm((trace(S_f)-P),2) <= 1e-5;
```

`cvx_end`