Documentation Center

  • Trial Software
  • Product Updates

Compute Rank of a Matrix

The rank of a matrix is the number of independent rows of a matrix. For a matrix in its reduced row echelon form, the rank is the number of nonzero rows. To compute the rank of a matrix, use the linalg::rank function. For example, compute the rank of the following square matrix:

A := matrix([[1, 2, 3, 4], [5, 6, 7, 8],
    [9, 10, 11, 12], [13, 14, 15, 16]]):
linalg::rank(A)

Now, compute the reduced row echelon form and the rank of the following 3×4 matrix:

OriginalMatrix := matrix([[1, 2, 3], [5, 6, 7],
                    [9, 10, 11], [13, 14, 15]]);
RREF = linalg::gaussJordan(OriginalMatrix);
Rank = linalg::rank(OriginalMatrix)

Was this topic helpful?