Contents Previous Next Subchapters Current Chapters-> kron inv trace det logdet rank cond null orth pinv cholesky lu svd qr qred eigen geneig eigsym symeig schur levinson tridiag BlockTriDiag Parent Chapters-> Omatrix6 linear rank Search Tools-> contents reference index search

Computing The Rank Of A Matrix
 Syntax `rank(`x`)` `rank(`x`, `tol`)` See Also cond , det , trace

Description
Returns the integer scalar that equals the rank of the matrix x, where x is an integer, real, double-precision, or complex matrix. The rank of a matrix is computed as the number of absolute singular values of x that are larger than tol where tol is an integer, real, or double-precision scalar. If tol is not present, ```      tol = maxdim * maxabs * eps ```is used where, `matdim` is the maximum of the row and column dimension of x, `maxabs` is the maximum absolute singular value of x, and `eps` is machine epsilon . If x is a real matrix, machine epsilon corresponds to single precision, otherwise it corresponds to double-precision.

Example ```      x = {[1, 0], [0, 2]}      rank(x) ``` returns ```      2 ```