The book that I'm reading states clearly that the covariance matrix $\Sigma$ in the following equation is a positive semidefinite and symmetric matrix.
$$ p(x) = det(2\pi\Sigma)^{-1/2} exp\{ -\frac{1}{2} (x-\mu)^{T} \Sigma^{-1}(x-\mu) \} $$
However, when I use mvnpdf() in Matlab, I get an error that the covariance matrix must be a positive definite matrix. Any suggestions?
The answer is that Matlab being a numeric software will need to actually compute the PDF using a numeric algorithm and this makes the case where $\Sigma$ is semi-positive-definite or singular problematic. As stated in Matlab's documentation page: