LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Look up Table

Very well spoted Smercurio ! You are rgiht... Smiley Sad

Kevin, to solve this problem you can either check that thread or insert a precision before the equality test.

Message Edité par TiTou le 03-14-2006 04:32 PM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 11 of 13
(767 Views)
Kevin,

Use two 1D arrays. The Input arrays has the numbers you want to search and the Output array has the output values. Both arrays have the same number of elements.

The Search 1D Array function can return the index of the element in the Input array which contains a match to the input value. Then use that index as an input to the Index Array function applied to the Output array to get the output you want.

If you use this approach, be very careful becuase if your input values are calculated results, they may not be EXACT matches to the values entered into your lookup array. There have been several threads about representation of real numbers in the finite space allocated to a computer variable.

For example your original post includes values like -0.33 and 1.67. If those are to be tested against -1/3 or 5/3, the matches will fail, because those numbers are NOT equal. If you need to do tests like these, let us know and we can offer methods which will probably give the results you want.

Lynn
0 Kudos
Message 12 of 13
(760 Views)

I have got it working now.

Thanks everyone for the help.

 

Best wishes

Kevin

0 Kudos
Message 13 of 13
(737 Views)