VEC_TO_DIAG
This procedure creates the diagonal matrix C using the values stored in the one-column matrix A.
Usage
The VEC_TO_DIAG stored procedure has the following syntax:
- VEC_TO_DIAG(matrixA,matrixC)
- Parameters
- matrixA
- The name of the one-column input matrix A.
- matrixC
- The name of the output matrix C.
Examples
call nzm..shape('1,2,3,4',4,1,'A');
call nzm..vec_to_diag('A', 'B');
call nzm..print('A');
call nzm..print('B');
call nzm..delete_matrix('A');
call nzm..delete_matrix('B');
SHAPE
-------
t
(1 row)
VEC_TO_DIAG
-------------
t
(1 row)
PRINT
-------------------------
-- matrix: A --
1
2
3
4
(1 row)
PRINT
-------------------------------------------------------------
-- matrix: B --
1, 0, 0, 0
0, 2, 0, 0
0, 0, 3, 0
0, 0, 0, 4
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)