Replace Array Subset Function

Owning Palette: Array VIs and Functions

Requires: Base Development System

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.

Details  Example

 Add to the block diagram  Find on the palette
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).

Replace Array Subset Details

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.

Example

Refer to the Replace Array Elements VI in the labview\examples\Arrays directory for an example of using the Replace Array Subset function.

 Open example  Find related examples