Identity matrix (identity_matrix)
Identity matrix of a given size.
How to write it
identity_matrix(n)
- n
- The number of rows and columns. Takes a whole number.
Examples
identity_matrix(3)In the solver,
Open in the solveridentity_matrix(3)gives[[1, 0, 0], [0, 1, 0], [0, 0, 1]].
Related functions
- hilbert_matrix
Hilbert matrix of a given size: the entry in row i and column j is 1/(i + j - 1).
- diagonal_matrix
A matrix with the given list on its diagonal and zeros elsewhere.
- matrix_exp
Exponential of a square matrix.
- matrix_function
A function of a square matrix.
- matrix_log
Logarithm of a square matrix.
- matrix_power
A square matrix to a whole power.