Determine whether matrix is ill conditioned
tf = isIllConditioned( returns
true) if the original coefficient
A used to create decomposition
ill conditioned; otherwise, it returns logical
The test used depends on the type of decomposition:
'cod'decompositions — The coefficient matrix is ill conditioned if
rank(dA) < min(size(A)).
All other decompositions — The coefficient matrix is ill conditioned if
rcond(dA) < eps.
isIllConditioned returns logical
true), then solving a linear system with either
b/dA displays a warning. Use the
CheckCondition property of the decomposition object
dA to turn off these warnings.
Check Condition of Coefficient Matrix
Create a matrix decomposition object for a 25-by-25 Hilbert coefficient matrix and then check to see whether the underlying coefficient matrix is ill conditioned.
A = hilb(25); dA = decomposition(A)
dA = decomposition with properties: MatrixSize: [25 25] Type: 'ldl' Show all properties
tf = isIllConditioned(dA)
tf = logical 1
Check the reciprocal condition number of the coefficient matrix. In this case
isIllConditioned determines that the coefficient matrix
A is ill conditioned because
rcond(dA) is smaller than
ans = 4.5130e-20
isIllConditioneduses rank and condition number estimates of the decomposition object. These estimates can differ compared to calling
rcond(A)on the coefficient matrix directly.