Documentation

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

rank

Rank of matrix

Syntax

k = rank(A)
k = rank(A,tol)

Description

The rank function provides an estimate of the number of linearly independent rows or columns of a full matrix.

k = rank(A) returns the number of singular values of A that are larger than the default tolerance, max(size(A))*eps(norm(A)).

k = rank(A,tol) returns the number of singular values of A that are larger than tol.

More About

collapse all

Tips

Use sprank to determine the structural rank of a sparse matrix.

Algorithms

There are a number of ways to compute the rank of a matrix. MATLAB® software uses the method based on the singular value decomposition, or SVD. The SVD algorithm is the most time consuming, but also the most reliable.

The rank algorithm is

s = svd(A);
tol = max(size(A))*eps(max(s));
r = sum(s > tol);

See Also

Introduced before R2006a

Was this topic helpful?