Documentation

rcond

Reciprocal condition number

Syntax

Description

example

C= rcond(A)returns an estimate for the reciprocal condition ofAin 1-norm. IfAis well conditioned,rcond(A)is near 1.0. IfAis badly conditioned,rcond(A)is near 0.

Examples

collapse all

Examine the sensitivity of a badly conditioned matrix.

A notable matrix that is symmetric and positive definite, but badly conditioned, is the Hilbert matrix. The elements of the Hilbert matrix are H ( i , j ) = 1 / ( i + j - 1 )

Create a 10-by-10 Hilbert matrix.

A = hilb(10);

Find the reciprocal condition number of the matrix.

C = rcond(A)
C = 2.8286e-14

The reciprocal condition number is small, soAis badly conditioned.

The condition ofAhas an effect on the solutions of similar linear systems of equations. To see this, compare the solution of A x = b to that of the perturbed system, A x = b + 0 0 1

创建一个列向量的和求解e A x = b

b = ones(10,1); x = A\b;

Now change b by0.01and solve the perturbed system.

b1 = b + 0.01; x1 = A\b1;

Compare the solutions,xandx1

norm(x-x1)
ans = 1.1250e+05

SinceAis badly conditioned, a small change inbproduces a very large change (on the order of 1e5) in the solution tox = A\b。系统m is sensitive to perturbations.

Examine why the reciprocal condition number is a more accurate measure of singularity than the determinant.

Create a 5-by-5 multiple of the identity matrix.

A = eye(5)*0.01;

This matrix is full rank and has five equal singular values, which you can confirm by calculatingsvd(A)

Calculate the determinant ofA

det(A)
ans = 1.0000e-10

Although the determinant of the matrix is close to zero,Ais actually very well conditioned andnotclose to being singular.

Calculate the reciprocal condition number ofA

rcond(A)
ans = 1

The matrix has a reciprocal condition number of1and is, therefore, very well conditioned. Usercond(A)orcond(A)rather thandet(A)to confirm singularity of a matrix.

Input Arguments

collapse all

Input matrix, specified as a square numeric matrix.

Data Types:single|double

Output Arguments

collapse all

Reciprocal condition number, returned as a scalar. The data type ofCis the same asA

The reciprocal condition number is a scale-invariant measure of how close a given matrix is to the set of singular matrices.

  • IfCis near 0, the matrix is nearly singular and badly conditioned.

  • IfCis near 1.0, the matrix is well conditioned.

Tips

  • rcondis a more efficient but less reliable method of estimating the condition of a matrix compared to the condition number,cond

Extended Capabilities

Introduced before R2006a