You have not provided a reproducible problem because you have not provided the input data. Please produce a minimally-sized self-contained problem which exhibits the error…

Nevertheless, per http://cvxr.com/cvx/doc/dcp.html#constraints One or both sides of an equality constraint may be complex; inequality constraints, on the other hand, must be real.

aphPtotal is real but the left-hand side is presumably complex because S is declared complex.SO the LHS of Sumvector’*S <= aphPtotal;; is complex, in violation of CVX’s rules.