Table Of Contents

Get Matrix Elements (G Dataflow)

Version:
Last Modified: December 18, 2017

Returns the elements of matrix beginning at index (row), index (col).

Programming Patterns

If you wire scalar values i, j to index (row) and index (col), respectively, this node returns a scalar that contains the element at location (i, j).

connector_pane_image
datatype_icon

matrix

2D array of any numeric type.

datatype_icon

index (row)

Integer, floating-point numeric, 1D array of integers, or 1D array of a floating-point numeric.

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

Default: 0

datatype_icon

index (col)

Integer, floating-point numeric, 1D array of integers, or 1D array of a floating-point numeric.

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

Default: 0

datatype_icon

output matrix

Scalar or 2D array that contains the matrix elements. The data type of output matrix is the same as the data type of matrix.

To add additional output matrix outputs, resize the node.

Output Behavior with 1D Arrays

If you wire a 1D array of numeric data to index (row) or index (col), this node returns one matrix element for each location specified. To determine these locations this node pairs each row index in index (row) with each column index in index (col). For example, if you pass the array of integers {1, 2, 4} to index (row) and the integer {5} to index (col), this node retrieves matrix elements at indexes (1, 5), (2, 5), and (4, 5). In this case, the output is a column vector, or 3 x 1 matrix.

Leaving Inputs Empty or Unwired

If you leave certain inputs empty or unwired, this node returns a portion of matrix or invalid operations as described in the following table.

Input Result
You wire an empty matrix to matrix. output matrix returns an invalid operation value at each exterior location.
You wire an empty 1D array to index (row) or index (col). output matrix returns an empty matrix with 0 in the corresponding row or column dimension.
You do not wire index (row) and index (col). output matrix returns a column vector with the first column 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