This function searches a numeric value d in dataset vd and returns the value in vref whose index number is the same as d in vd. Interpolation can be employed during this process. This function is usually used to find out the fitted X or Y values after performing the linear or nonlinear fitting, depending on the order of the dataset arguments (See the two examples below).
//If vref contains numeric values, double Table(vector vd, vector vref, double d[, int option]) //If vref contains strings, string Table(vector vd, vector<string> vref, double d[, int option])
vd
vref
d
option
Returns the value in vref whose index number is the same as d in vd.
Example1
The following script returns new Y values from a fit curve:
linearfit_Ynew = Table(linearfit_a, linearfit_data1b, linearfit_b)
where linearfit_a is the X fit dataset, linearfit_data1b is the Y fit dataset, and linearfit_b holds the X values for predicting Y values.
Example2
The following script returns new X values from a fit curve:
linearfit_Xnew = Table(linearfit_data1b, linearfit_a, linearfit_b)
where linearfit_data1b is the Y fit dataset, linearfit_a is the X fit dataset, and linearfit_b holds the Y values for predicting X values.
Example3
The following example shows you how the return value is determined by parameter option
col(a) = data(1,20); col(b) = data(2,20); a1 = table(col(a),col(b),4.3,1); //search 4.3 from right a1 = ; //should return a1=6 a2 = table(col(a),col(b),4.3,0); //search 4.3 from left a2 = ; //should return a2=5 a3 = table(col(a),col(b),4.3,2); //search 4.3 from both sides a3 = ; //should return a3=5 a4 = table(col(a),col(b),4.3,-1); //perform linear interpolation on column A and B a4 = ; //should return a4=5.3