cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

pulling out values from a 1D array based on look-up-table...probably quite simple??

Highlighted

pulling out values from a 1D array based on look-up-table...probably quite simple??

Hi
I would like to match data from a 1D array to the first column of a Look-up-table (LUT) and return the corresponding value on the second column of the LUT. The results should be stored in a new 2D array with the first column being the matching value from the original 1D array and the second column its corresponding value from the second column of the LUT.
 
For clarity, I have attached the front pannel explanation with my data.
 
I hope someone can help.
 
Best wishes,
 
 
0 Kudos
Message 1 of 2
(681 Views)

Re: pulling out values from a 1D array based on look-up-table...probably quite simple??

Is the LUT always increasing? At the moment you have it incremented by one, so you don't even need to look it up, just calculate the index directly.
What should happen if the exact element is not found? (e.g. return NaN, interpolate between adjacent elements, etc.)
 
Since you have all integers, why are you using DBL?
 
Attached (LabVIEW 8.0) shows three possible solutions that should give you some ideas. You probably need to modify for your exact requirements.

LabVIEW Champion Do more with less code and in less time
Message 2 of 2
(676 Views)