Jump to content

Delete From Array function: Difference between revisions

From LabVIEW Wiki
Add new page (stub)
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{stub}}
[[File:Delete From Array - Terminals.png|thumb|Delete From Array function]]
[[File:Delete From Array - Terminals.png|thumb|Delete From Array function]]


Deletes an element or subarray of specified length from an n-dimensional array at the specified index. Deletes one element if the length isn't specified. Removes elements from the end of an array if the index is not specified or negative. Returns the modified array as well as the deleted portion.
{{LabVIEW Palette Object Information|palette=Functions Palette/Programming/Array{{!}}Array palette|type=function|icon=Delete From Array.png}}


{{LabVIEW Palette Object Information|palette=Functions Palette/Programming/Array{{!}}Array palette|type=function}}
The '''Delete From Array''' function deletes an element or subarray from an array and returns the deleted portion.


== Usage ==
== Usage ==


== Best practice ==
Connect an array to the '''n-dim array''' input terminal to delete the last element.
 
[[File:Delete From Array - Delete Last Element.png]]
 
Connect an index to the '''index''' terminal to delete that element.
 
[[File:Delete From Array - Delete Any Element.png]]
 
By default the '''length''' input terminal is set to ''1'', which causes the node to remove exactly one element from the array. Connecting a wire to this terminal will cause the output terminal '''deleted portion''' to change from a single element to an array of elements, even if only one element is removed.


== History ==
[[File:Delete From Array - Delete Any Number Of Elements.png]]


== See also ==
== Best practice ==


== External links ==
* Do not wire a value to the '''index''' terminal to remove elements from the end of an array.


[[Category:Array Palette]]
[[Category:Array Palette]]

Latest revision as of 04:41, 26 June 2020

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

The Delete From Array function deletes an element or subarray from an array and returns the deleted portion.

Usage

Connect an array to the n-dim array input terminal to delete the last element.

Connect an index to the index terminal to delete that element.

By default the length input terminal is set to 1, which causes the node to remove exactly one element from the array. Connecting a wire to this terminal will cause the output terminal deleted portion to change from a single element to an array of elements, even if only one element is removed.

Best practice

  • Do not wire a value to the index terminal to remove elements from the end of an array.