Quote:
Originally Posted by Ether
There are at least two classes of methods to do this.
Method1: Lookup Table.
You put the known X,Y points in a table (array) in your code, and you sort the points so that the X values are in order. Then you take your unknown X and search the table, comparing it to the X values in the table, until you find the two points in the table which it is between. Then you perform a calculation called "interpolation" to find the unknown Y value. This might sound difficult but it's really quite straightforward.
Method2: Mathematical Model
The most common mathematical model is a polynomial. You take all the given data and you try to find a polynomial which fits the data. Once you've got the polynomial, you just plug in your unknown X and compute the associated Y value. You can find this polynomial very easily using Excel spreadsheet using the "trendline" feature. Just type your X,Y data into Excel in to two columns, then graph it, then use the trendline feature to find a polynomial of chosen degree.
|
Funny, those are actually exactly the two ideas which my friend and I thought of. To be honest, I was convinced LabVIEW is designed to solve these kind of problems with quick and easy-to-use VIs. We will probably go with the second solution. However, are you sure there isn't a VI that already does this? (not out of lazyness, it's just very surprising)