I'm interested in calculating alot of covariance matrices, which all require an inversion of a symmetric matrix, and therefore the output should be symmetric. I've always been taught that using the backslash operator is better than using inv() or ^(-1), i.e.
Ainv = A\eye(size(A,1))
BUT! If I run the following code,
P = 1000; pp = randn(P); A = pp*pp'; issymmetric(A) issymmetric(inv(A)) issymmetric(A\eye(P))
this yields that inv() returns a symmetric matrix but '\' doesnt. Why is this the case?
Best Answer