Jump to content

Replace Array Subset function: Difference between revisions

From LabVIEW Wiki
m clarify behavior for out-of-range indexing
mNo edit summary
 
Line 1: Line 1:
[[File:Replace Array Subset - Terminals.png|thumb|Replace Array Subset function]]
[[File:Replace Array Subset - Terminals.png|thumb|Replace Array Subset function]]


{{LabVIEW Palette Object Information|palette=Functions Palette/Programming/Array{{!}}Array palette|type=function}}
{{LabVIEW Palette Object Information|palette=Functions Palette/Programming/Array{{!}}Array palette|type=function|icon=Replace Array Subset.png}}


The '''Replace Array Subset''' function replaces one or more elements or subarrays in an array. The source array remains unchanged if no element exists at the specified index.
The '''Replace Array Subset''' function replaces one or more elements or subarrays in an array. The source array remains unchanged if no element exists at the specified index.

Latest revision as of 04:38, 26 June 2020

Replace Array Subset function
Object information
Owning palette(s) Array palette
Type Function
Requires Basic Development Environment
Icon

The Replace Array Subset function replaces one or more elements or subarrays in an array. The source array remains unchanged if no element exists at the specified index.

Usage

Connect an array of any type to the n-dimension array input terminal and a new element or subarray to new element/subarray. This will replace element(s) in the array starting at index 0.

Specify an index at the index terminal to replace element(s) at any other position in the source array.

Change the number of replacements at the node by dragging the upper or lower side. This will cause the node to replace multiple element(s) at the second, third, ... position (index 1, 2, ...). A new element or subarray must be specified for each replacement.

Best practice

  • Do not specify an index for the first element or subarray (index 0).