My code is shown as shown. But it shows error 'inv'. But when I delete 'inv', it also shows error. Please help me, thanks

Do you see anywhere in the CVX Users’ Guide where it says you can take the inv of a CVX matrix expression? I don’t, because it is not allowed. That is not generally convex.

Given that the offending constraint is an equality constraint, it can only be convex if the RHS is affine, which it is not.