How to construct a PSD matrix by using small size PSD matrixes

Your question is confusing. I suppose it is related somehow to your previous thread How to calculate unknown vectors from semidefinite square matrix variable But I really don;t know what you are trying to do… But if what you are trying to do is non-convex, CVX can not handle it. (I don’t know, because I don’t know what you are trying to do. You can form a rank one matrix in CVX as an outer product of two vectors, providing that at most one of of the vectors in the product is a CVX variable or expression.)

As for your current program, I presume the oo entries in W are really each zeros(3); So you should write them that way.

Are your constraints W1 >= 0; W2 >= 0; W3 >= 0; meant to be element-wise? If so, you will need something acceptable to CVX, such as real(W1) >= 0 , etc. or whatever you want. If they are meant to indicated hermitian semidefinite, that is already accomplished in the variable declarations. And in any event, you have not specified sdp mode, so they will not be interpreted as such…