rank

Compute the rank of matrix A.

Syntax

R = rank(A)

R = rank(A, tol)

Inputs

A
The matrix whose rank is computed.
Dimension: matrix
tol
A threshold for rounding off near-zero singular values. The default is the product of max(size(A)), the largest singular value, and eps.
Type: double
Dimension: scalar

Outputs

R
The rank.
Type: integer

Examples

Matrix input with default tolerance:
R = rank([1,2,3;4,5,6;7,8,9.1])
R = 3
Matrix input with specified tolerance:
R = rank([1,2,3;4,5,6;7,8,9.1], 0.02)
R = 2