Threshold 1D Array function

From LabVIEW Wiki
Jump to: navigation, search
Threshold 1D Array function
Object information
Owning palette 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.

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 or the element at the specified index if no match is found.

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.

Threshold 1D Array - Threshold Out Of Range.png

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.