The IDENTITY function returns an identity array (an array with ones along the main diagonal and zeros elsewhere) of the specified dimensions.
This routine is written in the IDL language. Its source code can be found in the file identity.pro in the lib subdirectory of the IDL distribution.
Examples
A = [[ 2.0, 1.0, 1.0, 1.5], $
[ 4.0, -6.0, 0.0, 0.0], $
[-2.0, 7.0, 2.0, 2.5], $
[ 1.0, 0.5, 0.0, 5.0]]
inverse = INVERT(A)
PRINT, A ## inverse - IDENTITY(4)
Syntax
Result = IDENTITY( N [, /DOUBLE] )
Return Value
Returns an n by n identity array.
Arguments
N
The desired column and row dimensions.
Keywords
DOUBLE
Set this keyword to return a double-precision identity array.
Version History
See Also
FINDGEN, FLTARR