Previous Up Next

2.41.1  Identity matrix : idn identity

idn takes as argument an integer n or a square matrix.
idn returns the identity matrice of size n or of the same size as the matrix argument.
Input :

idn(2)

Output :

[[1,0],[0,1]]

Input :

idn(3)

Output :

[[1,0,0],[0,1,0],[0,0,1]]

Previous Up Next