VECDIAG
This procedure extracts the diagonal of a matrix.
Usage
The VECDIAG stored procedure has the following syntax:
- VECDIAG(matrixAname,matrixCname)
- Parameters
- matrixAname
- The name of input matrix A.
- matrixCname
- The name of output matrix C.
Details
This procedure extracts the diagonal of a matrix using C := diag(A), where A and C are matrices. Matrix A is a square matrix and matrix C is a one column matrix. Matrix C must not exist prior to the operation.
Examples
call nzm..shape('1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16',4,4,'A');
call nzm..VECDIAG('A','B');
call nzm..print('A');
call nzm..print('B');
call nzm..delete_matrix('A');
call nzm..delete_matrix('B');
SHAPE
-------
t
(1 row)
VECDIAG
---------
t
(1 row)
PRINT
--------------------------------------------------------------------
-- matrix: A --
1, 2, 3, 4
5, 6, 7, 8
9, 10, 11, 12
13, 14, 15, 16
(1 row)
PRINT
---------------------------
-- matrix: B --
1
6
11
16
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)