Function reference · Linear algebra
rank
Returns the rank of a matrix: the number of linearly independent rows.
Notation
rank(matrix)
Write it in an expression: nerdamer('rank(matrix([1,2],[2,4]))'), or in the Playground.
nerdamer.rank
nerdamer.rank(...args: [M]): Expression
A method on the default import. Arguments can be strings, as in Notation.
Parameters
matrix- A matrix of any shape.
Returns
The rank, an integer.
Examples
The second row is twice the first, so the rank is 1.
rank(matrix([1,2],[2,4]))
// → 1Open in PlaygroundSymbolic entries are treated as generic: this assumes a*d-b*c is not zero.
rank(matrix([a,b],[c,d]))
// → 2Open in PlaygroundA vector such as [1,2] is an error; wrap it in matrix to get a one-row matrix.
rank(matrix([1,2]))
// → 1Open in PlaygroundJavaScript examples
nerdamer.rank('matrix([1,2],[2,4])').text()
// → 1