Main Content

sprank

Structural rank

Description

r = sprank(A) calculates the structural rank of sparse matrix A.

example

Examples

collapse all

Calculate the structural rank of a 2-by-4 matrix.

A = [1 0 2 0
     2 0 4 0];
A = sparse(A);
rs = sprank(A)
rs = 
2

Compare the structural rank to the regular rank calculation.

rf = rank(full(A))
rf = 
1

For this matrix, the structural rank is 2 since two of the columns are nonzero. But the actual rank of the matrix is 1 since the columns are multiples of each other.

Input Arguments

collapse all

Input matrix, specified as a sparse matrix.

Data Types: single | double
Complex Number Support: Yes

More About

collapse all

Extended Capabilities

expand all

Version History

Introduced before R2006a

expand all

See Also

|