Operators |
get_diagonal_matrix — Get the diagonal elements of a matrix.
The operator get_diagonal_matrix generates a new matrix Vector and copies the diagonal elements of the Matrix to this new matrix. The Matrix is defined by the matrix handle MatrixID. The matrix Vector has one column and n rows, where n = number of diagonal elements. The operator returns the matrix handle VectorID of the matrix Vector . Access to the elements of the matrix is possible e.g. with the operator get_full_matrix.
If Diagonal = 0, the output of the Vector is the main diagonal of the Matrix .
Example:
If Diagonal is positive, the output Vector is the Diagonal-th super-diagonal of the Matrix .
Example:
If Diagonal is negative, the Diagonal-th sub-diagonal of the Matrix is copied.
Example:
Matrix handle of the input matrix.
Number of the desired diagonal.
Default value: 0
Suggested values: -20, -10, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20
Matrix handle containing the diagonal elements.
If the parameters are valid, the operator get_diagonal_matrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
get_full_matrix, get_value_matrix
Foundation
Operators |