# LabVIEW

cancel
Showing results for
Did you mean:

## Re: 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?

Message 11 of 16
(175 Views)

## Re: Array + If Else?

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"
Message 12 of 16
(169 Views)

## Re: Array + If Else?

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

Alan

Message 13 of 16
(168 Views)

## Re: Array + If Else?

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.

Message 14 of 16
(162 Views)

## Re: Array + If Else?

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"
Message 15 of 16
(159 Views)

## Re: Array + If Else?

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"
Message 16 of 16
(128 Views)