Replace Array Subset function: Difference between revisions
Appearance
Created page with "{{stub}} thumb|Replace Array Subset function Replaces an element or subarray in an n-dimensional array at the specified index. R..." |
mNo edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
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|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. | |||
== Usage == | == 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. | |||
[[File:Replace Array Subset - Replace First Element.png]] | |||
Specify an index at the '''index''' terminal to replace element(s) at any other position in the source array. | |||
[[File:Replace Array Subset - Replace Specific Element.png]] | |||
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. | |||
[[File:Replace Array Subset - Replace Multiple Elements.png]] | |||
== | == Best practice == | ||
* Do not specify an index for the first element or subarray (index 0). | |||
[[Category:Array Palette]] | [[Category:Array Palette]] |
Latest revision as of 04:38, 26 June 2020

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).