I have a minimization objective like this:

In my code I am trying to represent it as:

```
cvx_begin
variable X(size(A));
idx = eye(size(A));
Y = (1-idx).*X;
minimize ( -log_det(X) + S * X + lambda * Y );
cvx_end
```

I am getting this error:

Your objective function is not a scalar.

A is a random matrix the same size as S.

Can you all please suggest what I am doing wrong? Thanks!