Navigation

Operators and Keywords

Function List:

C++ API

: rank (A)
: rank (A, tol)

Compute the rank of matrix A, using the singular value decomposition.

The rank is taken to be the number of singular values of A that are greater than the specified tolerance tol. If the second argument is omitted, it is taken to be

tol = max (size (A)) * sigma(1) * eps;

where eps is machine precision and sigma(1) is the largest singular value of A.

The rank of a matrix is the number of linearly independent rows or columns and determines how many particular solutions exist to a system of equations. Use null for finding the remaining homogenous solutions.

Example:

x = [1 2 3
     4 5 6
     7 8 9];
rank (x)
  ⇒ 2

The number of linearly independent rows is only 2 because the final row is a linear combination of -1*row1 + 2*row2.

See also: null, sprank, svd.

Package: octave