Q is a projection matrix, which is used to calculate the principal component Y of the original matrix X.
Y = Q^T*X, and there exists a cvx problem that

variable Q(m,n)
*maximize(trace(Q’AA’Q)) subject to
*Q’Q == I
I is a unit matrix
and the matlab shows the below error：
Disciplined convex programming error for the code “*maximize(trace(Q’AA’Q))”:
Only scalar quadratic forms can be specified in CVX

trace(Q'*A*A'*Q) can be rewritten as square_pos(norm(A'*Q,'fro')) , which is convex. But maximizing that is not convex. Not squaring the ‘fro’ norm would be equivalent, and is convex, but maximizing it is not convex.

And the orthonormality constraint Q'*Q == eye(n) is non-convex.

So, except for the objective and constraint being non-convex, this would be a convex optimization problem.

PCA is not a convex optimazation problems, but it’s dual gap has been proven 0. So you can solve its dual problem(a SDP). Also, you can just use the special method to solve(eig vector…)