MATLAB: Is the inverse of a symmetric matrix not symmetric?!

covariance-matrixmatrix inversionsymmetric matrix

Hi all, As far as I know, the inverse of symmetric matrix is always symmetric. However, I have a symmetric covariance matrix, call it C, and when I invert it (below), the solution, invC, is not symmetric!
>> invC = inv(C); % (inefficient I know, but it should still work...)
>> isequal(invC,invC')
ans = 0
Has anyone had this issue? Can this be due to rounding errors? My matrix is 1810×1810 with many entries like 0.0055, etc.
Thanks in advance!

Best Answer

Yes, it's roundoff error. Instead of 'isequal' which demands exact equality, try displaying the difference invC-invC' to see if the differences fall within the range of what you would regard as reasonable round off errors. With a matrix which is close to being singular these can be surprisingly large sometimes.