Jump to content

Array Max & Min 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:Array Max and Min - Terminals.png|thumb|Array Max & Min function]]
[[File:Array Max and Min - Terminals.png|thumb|Array Max & Min 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=Array Max and Min.png}}
 
The '''Array Max & Min''' function returns the maximum and minimum values and indices in an array.


== Usage ==
== Usage ==


== Best practice ==
Connect an array of any size and dimensionality to the '''array''' input terminal in order to receive the maximum and minimum values and indices.
 
[[File:Array Max & Min - Numeric Array.png]]
 
The output changes depending on the contained data type of the array. If two elements have the same value, the element with the <u>lowest</u> index is returned.


== History ==
{| class="wikitable"
!
! Description
|-
! Numeric
| [[Numeric]] elements are evaluated based on their value.
|-
! String
| [[String|Strings]] are evaluated based on their [[Wikipedia:ASCII|ASCII]] values. If two elements have the same ASCII character, the next character is evaluated (i.e. "AA" < "AB").
|-
! Cluster
| [[Cluster|Clusters]] are evaluated based on their first contained element (cluster element at index zero).
|}


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


== External links ==
* Use the [[Search 1D Array function|Search 1D Array]] function for [[Boolean]] arrays.


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

Latest revision as of 12:09, 29 June 2020

Array Max & Min function
Object information
Owning palette(s) Array palette
Type Function
Requires Basic Development Environment
Icon

The Array Max & Min function returns the maximum and minimum values and indices in an array.

Usage

Connect an array of any size and dimensionality to the array input terminal in order to receive the maximum and minimum values and indices.

The output changes depending on the contained data type of the array. If two elements have the same value, the element with the lowest index is returned.

Description
Numeric Numeric elements are evaluated based on their value.
String Strings are evaluated based on their ASCII values. If two elements have the same ASCII character, the next character is evaluated (i.e. "AA" < "AB").
Cluster Clusters are evaluated based on their first contained element (cluster element at index zero).

Best practice