Hi, I have a convex problem aiming at the minimization of two matrices, namely A and C, subject to some constraints. In particular:

*A is an NxN symmetric matrix semidefinite positive, with offdiagonal values <=0 and diagonal >=0*

C is a semidefinite positive matrix KxK, who admit \mathbf{C=B^{-1} \Lambda_{k} B}, where Lambda is a diagonal matrix.

The objective function to minimize is

\min _ { \mathbf { A \in \mathbb{R^{N \times N}}} , \mathbf { C \in \mathbb{R^{K \times K}} } } \sum _ { m = 1 } ^ { M } \sum _ { i , j = 1 } ^ { N } -A _ { i j } \left| Y _ { i m } - Y _ { j m } \right| + \mu \| \mathbf { A} \| _ { F } ^ { 2 }

subject to

\operatorname { tr } ( \mathbf { A } ) = p , A _ { i j } = A _ { j i } \leq 0 , i \neq j , \quad \mathbf { A } \cdot \mathbf { 1 } = \mathbf { 0 } , \\ \mathbf { C } \succeq \mathbf { 0 }, \mathbf{A U= UC}

The code I have written is as follow:

```
cvx_clear
cvx_begin
variable A_recovered(param.N,param.N) semidefinite
variable Ck(param.K,param.K) semidefinite
expression Objective;
Objective = param.mu* sum_square(vec(A_recovered))
for m=1:param.M
for i=1:param.N
for j=1:param.N
Objective= Objective - A_recovered(i,j)*abs(Y(i,m)-Y(j,m));
end
end
end
minimize Objective
subject to
A_recovered*U==U*C
A_recovered*ones(param.N,1)==zeros(param.N,1)
for i=1:param.N
for j=1:param.N
if j~=i
A_recovered(i,j)<=0;
A_recovered(j,i)<=0;
A_recovered(i,j)==A_recovered(j,i);
end
end
end
diag(A_recovered)>=0;
trace(A_recovered)==p;
cvx_end
```

Is the format of both objective function and constraints written in the correct form as in the mathematical formlation? Thank You