Hi all,
I am trying to use the chol() function to find the upper/lower triangular Cholesky factor of the following 3-by-3 matrix:
X = [1.000000000000000, 0.316227766016838, 1.732050807568878;0.316227766016838, 2.000000000000000, 1.643167672515499;1.732050807568878, 1.643167672515499, 3.000000000000002];
The matrix is symmetric:
X == X'ans =3×3 logical array 1 1 1 1 1 1 1 1 1
Using svd() yields that the matrix has 3 real, strictly positive eigenvalues and is therefore positive definite and full rank:
svd(X)ans = 4.885302431570409 1.303185501452844 0.188487933023250
The rank function confirms that X is full rank:
rank(X)ans = 3
However, when trying to use the chol() function to obtain the upper/lower Cholesky factor of X it fails:
chol(X)Error using cholMatrix must be positive definite.
Any help with this problem would be much appreciated.
Thanks in advance!
Best Answer