Array Size
- Updated2023-02-17
- 3 minute(s) read
Array Size
Returns the number of elements in each dimension of an array.

Inputs/Outputs

array
An n-dimensional array of any type.
This input also accepts clusters containing a single array, such as waveforms. This input changes to waveform when the data type is a waveform.
Data Type Changes on FPGA
When you add this node to a document targeted to an FPGA, this input has a default data type that uses fewer hardware resources at compile time.

waveform
The waveform whose array of y values you want to use in this operation. This input becomes available when you wire a waveform to array.

size(s)
The number of elements in the array.
This output returns different data types, depending on the dimension of the array:
- One-dimension—This output returns a 32-bit integer.
- Multidimensional—This output returns a 1D array in which each element is a 32-bit integer that represents the number of elements in the corresponding dimension of array.
Representation of Array Dimensions in the Output Array
For multidimensional arrays, the order of elements in the output array corresponds to row-major order. Thus, the first dimension in the input array always corresponds to the last element in the output array. The following table shows how output array elements correspond to input array dimensions for a 4D array.
Element in Output Array | Corresponding Input Array Dimension | Index Name |
---|---|---|
1 | 4th | Volume |
2 | 3rd | Page |
3 | 2nd | Row |
4 | 1st | Column |

size
The number of elements in the waveform's array of y values. This output becomes available when the input data type is a waveform.
Examples
Diagram | Panel Indicator | Comments |
---|---|---|
![]() |
![]() |
size(s) for 1D Array returns a scalar element with the size of the input array. |
![]() |
![]() |
size(s) for 2D Array returns a 1D array where each element corresponds to the size of a dimension in the input array. The first element returns the number of rows in the input array, and the second element returns the number of columns in the input array. |