Get Matrix Diagonal Function

Owning Palette: Matrix Functions

Requires: Base Development System

Returns the diagonal of matrix beginning at the index (row, column).

Add additional row and column inputs and matrix diagonal outputs by resizing the node.

The connector pane displays the default data types for this polymorphic function.

Details  

 Add to the block diagram  Find on the palette
matrix must be a 2D array of any numeric type or a real or complex matrix.
row must be an integer or real number. row is the starting row index in the output. The default is 0.
column must be an integer or real number. column is the starting column index in the output. The default is 0.
matrix diagonal is the matrix or 2D array that contains the diagonal elements in matrix.

Get Matrix Diagonal Details

The matrix diagonal output is a matrix or 2D array with one column and has the same the numeric type as matrix. If you wire a matrix to matrix, matrix diagonal returns a column vector. If you wire a 2D array to matrix, matrix diagonal returns a 2D array.

If you do not wire row and column, matrix diagonal returns the main diagonal of matrix. If you do not wire column, matrix diagonal returns a lower diagonal. If you do not wire row, matrix diagonal returns an upper diagonal.

Indexing Outside Input Values

If you wire a negative value to row and no value to column, matrix diagonal returns the same results as if you wired the same positive value to column and left row unwired. If you wire a negative index to column and no value to row, matrix diagonal returns the same result as if you wired the same positive value to row and left column unwired.

If you wire values to row and column and one value is negative, the other value must be 0. If the other value is not 0, matrix diagonal returns an empty matrix or array.

If you wire a value to row that is greater than or equal to the matrix row dimension or a value to column that is greater than or equal to the matrix column dimension, matrix diagonal returns an empty matrix or array.

Extracting Subdiagonals

If you wire positive values to row and column that are less than the row and column dimensions of the matrix, the function returns a subdiagonal. The subdiagonal includes the diagonal elements starting at (row, column) and ending at the last element of the diagonal.

If row is less than column, matrix diagonal returns a portion of the upper diagonal. If row is greater than column, matrix diagonal returns a portion of the lower diagonal. If row equals column, matrix diagonal returns a portion of the main diagonal.