Table Of Contents

Set Matrix Diagonal (G Dataflow)

Last Modified: December 18, 2017

Sets the diagonal of matrix beginning at index (row), index (col).

connector_pane_image
datatype_icon

matrix

2D array of any numeric type.

datatype_icon

index (row)

Starting row index in the output.

Can be an integer or real number.

To add additional index (row) inputs, resize the node.

Default: 0

datatype_icon

index (col)

Starting column index in the output.

Can be an integer or real number.

To add additional index (col) inputs, resize the node.

Default: 0

datatype_icon

new diagonal/fill element

2D array of any numeric type that replaces the diagonal elements in matrix.

To add additional new diagonal/fill element inputs, resize the node.

datatype_icon

output matrix

matrix with the new diagonal.

To add additional output matrix outputs, resize the node.

Leaving Inputs Unwired

If you leave inputs unwired, this node behaves as described in the following table.

Input Result
You wire matrix and no other inputs. output matrix returns matrix with the main diagonal set to zero.
You wire index (col) and do not wire index (row). output matrix returns matrix with the upper diagonal starting at (0, index (col)) set to the new diagonal elements.
You wire index (row) and do not wire index (col). output matrix returns matrix with the lower diagonal starting at (index (row), 0) set to the new diagonal elements.

Wiring the New Diagonal/Fill Element Input

When you wire inputs to new diagonal/fill element, this node behaves as described in the following table.

Input Result
You wire a matrix to new diagonal/fill element. If you wire a matrix containing one column, this node returns a matrix with the diagonal set to the elements in that column. If you wire a matrix with more than one column, this node ignores the additional columns.
You wire an empty matrix to new diagonal/fill element. output matrix returns matrix.
You wire an input to new diagonal/fill element that contains fewer elements than the diagonal or subdiagonal that starts at index (row), index (col). output matrix returns matrix with only the first elements in the diagonal or subdiagonal set to the new diagonal elements.
You wire an input to new diagonal/fill element that contains more elements than the diagonal or subdiagonal that starts at index (row), index (col). output matrix resizes to receive the new diagonal elements.
You wire an input to new diagonal/fill element with a different numeric type than matrix. This node converts matrix to the new numeric type if this node cannot set new diagonal elements without losing precision. If the node can set new diagonal elements without losing precision, the numeric type of new diagonal/fill element converts to the numeric type of matrix.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics