# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution
Highlighted

## Find index of an array value greater than certain number

Hello,

I am having a curve and I need a starting tangent of it, but random amount of values at start are useless so I need to find threshold, where the actual curve begins. For that purpose I built an array of the measured values and tried to find first value greater than certain number and it's index. I tried several ways to do that posted here on forum, but with no success.

I am having a LW 2009, could sb post a simplest possible VI that just finds first value in array greater than constant, and returns it's index?

And one minor question, is it better to build array of each value or just pull out graph history?

Message 1 of 6
(124 Views)

## Re: Find index of an array value greater than certain number

"Threshold 1D array" does what you want.

If you by "graph history" mean to read the value of the graph, then yes that works just fine.

G# - Award winning reference based OOP for LV, for free! VIPM Github
Message 2 of 6
(110 Views)

## Re: Find index of an array value greater than certain number

Well, I tried that, but I am unsure how this will work on real data with some fluctuations (meaning not sorted).

Message 3 of 6
(95 Views)

## Re: Find index of an array value greater than certain number

How about "greater than" in a for loop?

G# - Award winning reference based OOP for LV, for free! VIPM Github
Message 4 of 6
(90 Views)
Solution
03-25-2019 06:11 AM

## Re: Find index of an array value greater than certain number

I will usually do a comparison of the array, then search the output array for instances of true.

Message 5 of 6
(87 Views)

## Re: Find index of an array value greater than certain number

Tried for loop but the result was somewhat inconsistent, not sure what I've done wrong.

Will try the boolean array.

Message 6 of 6
(78 Views)