One or both sides of an equality constraint may be complex; inequality constraints, on the other hand, must be real.
Without seeing your code and data, I can’t make a definitive diagnosis. But it must be the case that
trace(A*B*A^H) has some imaginary component, even though it may be just due to roundoff. First of all, there is no such thing in MATLAB or CVX as
^H to denote hemnitian transpose. So I will assume that you actually used
B been declared to be hemnitian? If not, then
trace(A*B*A') will not be real.
If you actually did use
trace(A*B*A^H), then presumably
H was previously set in your MATLAB session to be some real or complex number, and
A*H would be the matrix
A raised to the power
H, which surely is not what you want.
B is declared hernitian and
trace(A*B*A') <= 1 produces an error message, then roundoff level imaginary component and the error can be eliminated using
real(trace(A*B*A')) <= 1