xolstis Posted December 15, 2005 Report Share Posted December 15, 2005 Hi there, am rather new to labview. Have been looking high and low for some kind of look-up table function that I might be able to implement in labview unsuccessfully. I need to be able to have a 2D table that gives out a single output taken from the table for a given set of two input variables. Anway to do this easily? Cheers Quote Link to comment
Götz Becker Posted December 15, 2005 Report Share Posted December 15, 2005 Are the two inputs the indices for that 2D Array? Then a simple "Index Array" is what you need. The function expands the index inputs depending on the dimension of the wired array input. But i guess i didn Quote Link to comment
Mike Ashe Posted December 15, 2005 Report Share Posted December 15, 2005 Hi there, am rather new to labview. Have been looking high and low for some kind of look-up table function that I might be able to implement in labview unsuccessfully. I need to be able to have a 2D table that gives out a single output taken from the table for a given set of two input variables. Anway to do this easily? Cheers Go to NI.com and in DevZone search for Parse Lookup Tableor try here: Parse Lookup Table Cheers :beer: Quote Link to comment
Neville D Posted December 15, 2005 Report Share Posted December 15, 2005 Hi there, am rather new to labview. Have been looking high and low for some kind of look-up table function that I might be able to implement in labview unsuccessfully. I need to be able to have a 2D table that gives out a single output taken from the table for a given set of two input variables. Anway to do this easily? Cheers Hi, Here is an implementation of a lookup table. The LUT can be either: - a 2d array of X-col, Y-col, OR - a 1d array of (X,Y) clusters. Given an X, it will interpolate a Y value. Note that the LUT must be monotonically increasing for the LV function to work! You can add additional logic to check for out of range X values, error generation, interpolating Y given X etc. as needed. Cheers, Neville. Download File:post-2680-1134673935.vi Quote Link to comment
xolstis Posted December 16, 2005 Author Report Share Posted December 16, 2005 Are the two inputs the indices for that 2D Array?Then a simple "Index Array" is what you need. The function expands the index inputs depending on the dimension of the wired array input. But i guess i didn Quote Link to comment
xolstis Posted December 16, 2005 Author Report Share Posted December 16, 2005 Hi,Here is an implementation of a lookup table. The LUT can be either: - a 2d array of X-col, Y-col, OR - a 1d array of (X,Y) clusters. Given an X, it will interpolate a Y value. Note that the LUT must be monotonically increasing for the LV function to work! You can add additional logic to check for out of range X values, error generation, interpolating Y given X etc. as needed. Cheers, Neville. Hi Neville, Have looked at the vi you attached. Correct me if I am wrong but it appears that this vi does something like curve fitting. As in given a graphical function (or in this case by interpolating a series of points on an array), the function returns a value of y for an input of x. Not too diff from say if you had a graph of y = 2x this function simply tells you what y is for a given value of x except in this case no graphical function is given but rather a 1D array is used. If I am correct in my conclusion this isn't quite what I need because the values I have to fit into the table will probably not fit into any function or curve. Have attached a picture to illustrate what I am trying to do. It sounds really simple but I can't seem to find a simple solution for it.... I am sure there is one and its just eluding me. The parse lookup table suggestion by Michael looks a little complicated am trying to look thru it now to see if it does what I require. Thanks for the help. Quote Link to comment
xolstis Posted December 16, 2005 Author Report Share Posted December 16, 2005 OK I finally found it was just an index function after all just like the first reply said sorry for the fuss ..... lol. Quote Link to comment
Mike Ashe Posted December 18, 2005 Report Share Posted December 18, 2005 The parse lookup table suggestion by Michael looks a little complicated am trying to look thru it now to see if it does what I require. Apply Occam's Razor: Always choose the simplist possible explaination or solution first. :headbang: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.