Jump to content

Array Subset function: Difference between revisions

From LabVIEW Wiki
Add new page (stub)
 
Add contents
Line 1: Line 1:
{{stub}}
[[File:Array Subset - Terminals.png|thumb|Array Subset function]]
[[File:Array Subset - Terminals.png|thumb|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}}
The '''Array Subset''' function returns a portion of an array.


== Usage ==
== Usage ==


== Best practice ==
Connect an array of any size and dimensionality to the '''n-dimensional array''' terminal. This creates a [[Wikipedia:NOP (code)|no-op]] which returns the entire input array unchanged (begin at index zero and return the rest).
 
[[File:Array Subset - No-op.png]]
 
Specify an index at the '''index''' terminal to return the rest of the array starting at the specified index.
 
[[File:Array Subset - Start at index.png]]
 
Specify a length at the '''length''' terminal to limit the maximum number of elements returned. The subarray will contain <u>at most</u> the number of elements defined by '''length'''.


== History ==
[[File:Array Subset - Start at index and limit length.png]]


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


== External links ==
* Always connect at least one of the '''index''' or '''length''' terminals.
* Use the '''[[Index Array function|Index Array]]''' function to access single elements and full subarrays.


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

Revision as of 19:28, 15 November 2019

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

The Array Subset function returns a portion of an array.

Usage

Connect an array of any size and dimensionality to the n-dimensional array terminal. This creates a no-op which returns the entire input array unchanged (begin at index zero and return the rest).

Specify an index at the index terminal to return the rest of the array starting at the specified index.

Specify a length at the length terminal to limit the maximum number of elements returned. The subarray will contain at most the number of elements defined by length.

Best practice

  • Always connect at least one of the index or length terminals.
  • Use the Index Array function to access single elements and full subarrays.