Replace Array Subset
- Updated2025-03-14
- 3 minute(s) read
Replaces an element or subarray in an array at the point you specify in index.
When you wire an array to this function, the function resizes automatically to display index inputs for each dimension in the array you wired. The connector pane displays the default data types for this polymorphic function.

Inputs/Outputs
![]() n-dimension array is the array in which you want to replace an element(s), row(s), column(s), or page(s). This input can be an n-dimension array of any type. ![]() index 0..n-1 specifies the element, row, column, or page you want to replace in the array. If you do not wire this input, the dimensions of the new element/subarray input determines the number of elements of n-dimension array, starting with element 0, this function replaces. If you specify an index without wiring the following indexes, this function continues from the last index you specify. For example, if you do not wire this input and n-dimension array consists of three elements, and new element/subarray consists of two elements, this function replaces only the first two elements (0 and 1) of n-dimension array. If you specify 1 for the first index without wiring other indexes and n-dimension array consists of three elements, and new element/subarray consists of two elements, this function replaces only the second and the third element (1 and 2) of n-dimension array.![]() new element/subarray is the array or element that replaces an element, row, column, or page in the array specified in n-dimension array. Note The base data type of the new element or subarray must be the same type as the input array.
![]() output array is the array this function returns with the replaced element(s), row(s), column(s), or page(s). |
Resize this function to replace multiple elements or array subsets at one time. Replace Array Subset does not affect the original input array. This function crops any subarray that is too large to fit as a column, row, or page in the input array. If any index is negative or larger than the corresponding dimension in n-dimension array the function has no effect.
FPGA Module Details
The following details apply when you use this object in an FPGA VI.
Single-Cycle Timed Loop | Supported. |
Usage | The LabVIEW FPGA Module supports only one-dimensional arrays that resolve to a single size at compile time. You can use constant or non-constant inputs. |
Timing | This function executes in one clock cycle. However, if you wire a constant immediately into the index input, the selection occurs at compile time and the function requires no clock cycles. |
Resources | When the index is not constant, this function consumes FPGA resources in proportion to the size of the array and size of new element/subarray. When the index is constant, this function consumes no FPGA resources. |
Notes | For large arrays, the Replace Array Subset function might not be able to execute within a single clock cycle, resulting in a compile-time error. |
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Arrays\Replace Array Elements.vi