{{indexmenu_n>999}}
====== Identity ======
###
Matrix.Identity(//n//) returns an identity matrix of size $n\times n$.
If the option "Userdata" is set to false (default is true) the output is returned as a table of tables rather than a pointer (compare //[[documentation:language_reference:objects:matrix:functions:ToUserdata|Matrix.ToUserdata()]]// and //[[documentation:language_reference:objects:matrix:functions:ToTable|Matrix.ToTable()]]//).
###
===== Example =====
==== Input ====
print(Matrix.Identity(3))
==== Result ====
{ { 1 , 0 , 0 } ,
{ 0 , 1 , 0 } ,
{ 0 , 0 , 1 } }
===== Table of contents =====
{{indexmenu>..:#2|tsort}}