Skip to content

rank

Numerical rank of a matrix.

r = rank(A)
r = rank(A, tol)

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.

rank([1 2; 2 4]) % 1 (linearly dependent rows)
rank(magic(3)) % 3
rank(magic(4)) % 3 (magic(4) is rank-deficient)
  • null — Orthonormal basis for the null space of a matrix.
  • svd — Singular value decomposition.
  • cond — Condition number of a matrix.