Suppose I have a matrix M.
M = [1, 2, 3; 3, 4, 5; 5, 6, 7]
M = 1 2 3 3 4 5 5 6 7
This is obviously a singular matrix, so the following orange warning is no surprise if I try to invert the matrix.
>> inv(M)Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 7.031412e-18.
I can compute the value of RCOND displayed in the warning with the MATLAB command rcond:
>> rcond(M)ans = 7.0314e-18
So now I want to solve a large system Ax=b where A is sparse (which is 5185×5185 and I unfortunately can't easily share) and I get the singular matrix warning.
>> A\bWarning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.163871e-22.
My question is, why does the following computation not agree with what MATLAB outputs in the warning?
>> rcond(full(A))ans = 6.7160e-10
Any ideas on how I can isolate this issue? I have a hard time believing this large discrepancy is due to using sparse matrices, but have no other leads on what could be happening.
Unfortunately this forum is flooded with people asking why their specific problem is ill-conditioned so searching did me no good.
Best Answer