Command Reference : Function Reference : Function Reference: I
  
 
@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 where a block equals Z multiplied by a random uniform number.
Cross-references
See also @ones, @unitvector, and @zeros.