MIMO channel capacity being complex?
The way you generate the covariance matrix is not right. I would either use Matlab's gallery, or generate a random matrix as follows:

A=rand(N)+j*rand(N);
Q=A*A';


To check if a matrix Q is positive semidefinite, you can look at the eigenvalues and see they are all nonnegative. You can use eig(Q) in Matlab.