LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array + If Else?

I give an example. Let say there is 2 number. First is 2.2323223 and the second is 2.23245454. If i use that high low vi, it will take both value. Now i only want to compare both and take the higher value in it. So, i use the round to nearest but it doesn't work. Can i know why? 

0 Kudos
Message 11 of 16
(175 Views)

Are these numbers in your locations array? Previously you said that if the locations array where the same to only get the highest amplitude. Are you saying now that you only want to compare the Locations array to 3 decimal places? ie

 

Locations Amplitude

2.23456      10

2.23477                  12

 

would return, Locations = 2.23477, Amplitude = 12 ?

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 12 of 16
(169 Views)

round to nearst will round them both to 2....

 

Alan

0 Kudos
Message 13 of 16
(168 Views)

Yeah, this number is in the location array.  It will take both values. And i try using round to nearest, somehow, it doesn't round to nearest.

0 Kudos
Message 14 of 16
(162 Views)

Tech,

 

I will modify the vi i sent you so you can insert the amount of decimal places you want it to be accurate too. Give me 10 mins.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 15 of 16
(159 Views)

Tech,

 

This will now allow you to specify the amount of decimal places you want it to be accurate too. You can even choose from rounding up/down/nearest.

 

The main vi you need is 'Approx duplicate hi lo selection' the others are sub vi's. You can use the 'Approx Array Hi Lo Example' vi to test.

 

This still needs fully de-bugging as i dont have time.

 

Let me know if it sorted your problem

 

Rgs,

 

Lucither

 

 

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 16 of 16
(128 Views)