Jump to content

Threshold 1D Array function: Difference between revisions

From LabVIEW Wiki
Add new page (stub)
 
Add content
 
Line 1: Line 1:
{{stub}}
[[File:Threshold 1D Array - Terminals.png|thumb|Threshold 1D Array function]]
[[File:Threshold 1D Array - Terminals.png|thumb|Threshold 1D Array 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 '''Threshold 1D Array''' function takes a one-dimensional array of numeric values to calculate the fractional index of the first element that intersects a given threshold <u>in positive direction</u>.


== Usage ==
== Usage ==


== Best practice ==
Connect a one-dimensional array to the '''array of numbers or points''' input terminal and specify a threshold value at '''threshold y'''. The return value will be a fractional index of the first element that intersects the threshold in positive direction.
 
[[File:Threshold 1D Array - Fractional Index Between Elements.png]]
 
Specify an index to start searching from at '''start index'''. The return value will be a fractional index of the first element that intersects the threshold in positive direction <u>or</u> the element at the specified index if no match is found.
 
[[File:Threshold 1D Array - Fractional Index Between Elements With Start Index.png]]
 
This function always returns the index of the last element if the threshold is higher than any value in the source array.


== History ==
[[File:Threshold 1D Array - Threshold Out Of Range.png]]


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


== External links ==
* Multiply the source array with <code>-1</code> to find the first element that intersects a given threshold value <u>in negative direction</u>.
* Use the '''[[Reverse 1D Array function|Reverse 1D Array]]''' function on the source array to find the <u>last</u> element that intersects a given threshold in positive direction.


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

Latest revision as of 17:32, 19 November 2019

Threshold 1D Array function
Object information
Owning palette(s) Array palette
Type Function
Requires Basic Development Environment

The Threshold 1D Array function takes a one-dimensional array of numeric values to calculate the fractional index of the first element that intersects a given threshold in positive direction.

Usage

Connect a one-dimensional array to the array of numbers or points input terminal and specify a threshold value at threshold y. The return value will be a fractional index of the first element that intersects the threshold in positive direction.

Specify an index to start searching from at start index. The return value will be a fractional index of the first element that intersects the threshold in positive direction or the element at the specified index if no match is found.

This function always returns the index of the last element if the threshold is higher than any value in the source array.

Best practice

  • Multiply the source array with -1 to find the first element that intersects a given threshold value in negative direction.
  • Use the Reverse 1D Array function on the source array to find the last element that intersects a given threshold in positive direction.