# Cholesky factorization for a non-positive semidefinite matrix

I was trying to build a random positive definite matrix and I came across this case.

$a=\begin{bmatrix}5 & 5\\ 16 & 7\end{bmatrix}$. The eigenvalues for this matrix are $eig=(-3, 15)$. So the matrix is not positive semi-definite (I suppose, correct me if I am wrong). Now I read that you can use Cholesky factorization command of MATLAB to ensure that the matrix is positive definite (I don't know if this is most efficient method, but that's not the concern). Here I use the command, and instead of getting an error, I get an answer:

chol_of_a=chol(a)

chol_of_a =$\begin{bmatrix}2.2361 & 2.2361\\ 0 & 1.4142\end{bmatrix}$

There is a sentence in the MATLAB documentation: If A is not positive definite, an error message is printed (while performing chol(A)). Why it is not giving an error if a is not positive-definite (since it has an eignevalue of -3?). What am I missing here?

Cholesky factorisation is only possible for symmetric matrices, and your $a$ is not symmetric.