LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I input a floor/ceiling to find an index?

Solved!
Go to solution

Hi all,

 

I'm still fairly new to Labview, so please bear with me if this has a very simple answer. I have an xy graph; the x is 'time' and the y is 'phase'. I want to determine what my phase is at a given time. I would just use the Index Array, but the 'time' array is not in integer values (i.e. index "10" might be something like 9.2 ps). What I would like to do is use Search 1D Array for the indices with a 10 ps floor/ceiling, and then interpolate the phase value for 10 ps. However, I cannot figure out how to do a floor/ceiling. In the mean time I'm working around it, but I would really like to be able to do this.

 

Thank you!

0 Kudos
Message 1 of 6
(7,122 Views)

Take a look at the Interpolate 1D Array function. It takes a fractional index as input and does linear interpolation. You find it in the Array palette.

0 Kudos
Message 2 of 6
(7,108 Views)

If you are just looking for a simple floor or ceiling operation, you can use the following: Round To +Inifinity and Round To -Infinity.

 

They can be found in the numeric palette:

round.JPG

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 3 of 6
(7,104 Views)
Solution
Accepted by topic author kebrown

Use the Interpolate 1D Array and Threashold 1D Array.  This is assuming your X is sorted in an ascending order.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(7,094 Views)

Look at "Threshold 1D Array", it pretty much does all that you're trying to do.

 

-DP

 

Untitled.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 5 of 6
(7,090 Views)

Thank you so much, this is exactly what I needed!

0 Kudos
Message 6 of 6
(7,071 Views)