Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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)=(100010001)\displaystyle \operatorname{identity\_matrix}(3) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}
    identity_matrix(3)

    In the solver, identity_matrix(3) gives [[1, 0, 0], [0, 1, 0], [0, 0, 1]].

    Open in the solver