CVX is not a symbolic analysis engine. Every single subexpression that you construct must satisfy the DCP ruleset. It does not even attempt to consider the entire expression globally.
So in your case, once CVX sees
(A-Ypie)*(A-Ypie)', it declares a DCP error. This is proper behavior even though the trace of this quantity is indeed convex. After all, only the diagonal elements of this expression are convex; the rest are non-convex. You're never allowed to construct a non-convex (or non-concave) expression in CVX, even if you end up throwing it away.
To fix this, you have to recognize that this trace quantity is actually the square of the Frobenius norm of
sum_square(A(:)-Ypie(:)) will do, as will
square_pos(norm(A-Ypie,'fro')), or (in CVX 3.0 beta only)
Of course, Johan's comment is entirely correct as well, and it's quite possible that none of this advice will apply once you have fixed your model to have a scalar objective.