Command Reference : Matrix Language Reference
  
 
@identity
Identity matrix.
Syntax: @identity(n)
n: integer
Return: matrix
Returns a square identity matrix.
Examples
matrix i4 = @identity(4)
creates a identity matrix.
matrix k4 = @kronecker(@fill(1, 2, 3), @identity(4))
generates the matrix formed by taking the Kronecker product of the 3 element vector and the identity matrix.
sym z = @inner(@mnrnd(3, 3))
matrix k3 = @kronecker(@scale(@identity(3), @mrnd(3, 1)), z)
creates a block diagonal matrix with blocks a random uniform multiplied by Z on the main diagonal.
Cross-references
See also @unitvector, @ones and @zeros.