# Rank of a matrix (rank)

Rank of a matrix: the number of independent rows.

## How to write it

### rank(matrix)

**matrix**

A matrix, written as a list of rows. Takes a matrix, written as a list of rows.

## Examples

- $\displaystyle \operatorname{rank} \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} = 2$

  `rank([[1, 2, 3], [4, 5, 6]])`

  In the solver, `rank([[1, 2, 3], [4, 5, 6]])` gives `2`.

  [Open in the solver](https://hilberon.com/?q=rank%28%5B%5B1%2C%202%2C%203%5D%2C%20%5B4%2C%205%2C%206%5D%5D%29)

## Related functions

- [row_reduce](https://hilberon.com/library/row_reduce)

  Reduced row echelon form of a matrix.
- [qr_decomposition](https://hilberon.com/library/qr_decomposition)

  QR decomposition of a matrix: an orthogonal factor and an upper triangular one.
- [schur_decomposition](https://hilberon.com/library/schur_decomposition)

  Schur decomposition of a square matrix: an orthogonal factor and an upper triangular one.
- [pseudo_inverse](https://hilberon.com/library/pseudo_inverse)

  Moore-Penrose pseudo-inverse of a matrix.
- [singular_value_decomposition](https://hilberon.com/library/singular_value_decomposition)

  Singular value decomposition of a matrix: two orthogonal factors and the singular values.
- [orthogonalize](https://hilberon.com/library/orthogonalize)

  Orthonormal vectors spanning the same space as some vectors, by the Gram-Schmidt process.

---
Source: https://hilberon.com/library/rank
