You can try if this way works out for you:
Create a diagonal Matrix $M$ with diagonal entries $(\geq) > 0$. Then take an invertible matrix $P$ and calculate $E = PMP^{-1}$, hence E and M are similar, hence E is also positive (semi-) definit. Using this way you have to worry about finding arbitrary invertible matrices. One way for that would be to do random elementary row/column operations to the identity matrix(for that you can create elementary matrices by random, which is an easy task).