CREATE_IDENTITY_MATRIX - create an identity matrix
This procedure creates an entity matrix of the size specified.
Usage
The CREATE_IDENTITY_MATRIX stored procedure has the following syntax:
- CREATE_IDENTITY_MATRIX(matrixOut,size)
- Parameters
- matrixOut
- The name of the matrix to be generated.
- size
- The number of rows and columns in the matrix.
Details
An identity matrix is a square matrix with values of one (1) along the main diagonal and values of zero (0) elsewhere.
Examples
CALL nzm..CREATE_IDENTITY_MATRIX('A', 5);
CALL nzm..PRINT('A');
CALL nzm..DELETE_MATRIX('A');
CREATE_IDENTITY_MATRIX
------------------------
t
(1row)
PRINT
---------------------------------------------------------------------------------------
-- matrix:A --
1, 0, 0, 0, 0
0, 1, 0, 0, 0
0, 0, 1, 0, 0
0, 0, 0, 1, 0
0, 0, 0, 0, 1
(1 row)
DELETE_MATRIX
---------------
t
(1 row)