rank
Numerical rank of a matrix.
Syntax
Section titled “Syntax”r = rank(A)r = rank(A, tol)Description
Section titled “Description”Returns the numerical rank of A — the number of singular values that exceed the tolerance tol. The default tolerance is max(size(A)) * eps(norm(A)).
The optional ref reference flag and tol are MathJet extensions that pass tolerance information through; for compatibility with MATLAB’s two-argument form, pass tolerance as the second argument.
Examples
Section titled “Examples”rank([1 2; 2 4]) % 1 (linearly dependent rows)rank(magic(3)) % 3rank(magic(4)) % 3 (magic(4) is rank-deficient)