Array Max & Min function: Difference between revisions
Appearance
Add new page (stub) |
Add content |
||
| Line 1: | Line 1: | ||
[[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}} | ||
The '''Array Max & Min''' function returns the maximum and minimum values and indices in an array. | |||
== Usage == | == 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. | |||
[[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. | |||
= | {| 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). | |||
|} | |||
== | == Best practice == | ||
* Use the [[Search 1D Array function|Search 1D Array]] function for [[Boolean]] arrays. | |||
[[Category:Array Palette]] | [[Category:Array Palette]] | ||
Revision as of 20:06, 15 November 2019

| Object information | |
|---|---|
| Owning palette(s) | Array palette |
| Type | Function |
| Requires | Basic Development Environment |
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
- Use the Search 1D Array function for Boolean arrays.
