TLOOKUP
TLOOKUP - table lookup, interpolation
Usage:
TLOOKUP X XP YP TYPE INV
Inputs:
X | argument (number or vector) |
XP | vector of X-values |
YP | vector of Y-values: YP[i] = f(XP[i]) |
TYPE | type of interpolation |
INV | selects how to process invalid X-values |
Outputs:
Y | interpolated function values (same type as X) |
Function:
For each X-value, an interpolated Y-value for the function defined by the value pairs (XP[i], YP[i]) is computed. All inputs except TYPE and INV are updated at the beginning of each evaluation cycle.
Interpolation method selected by input TYPE{| |- |value of TYPE |interpolation method |- |0 or SPLINE |spline interpolation, not yet implemented |- |1 or LINEAR |linear interpolation between two points of the function |- |2 or NEVILLE |polynomial interpolation using the Neville algorithm |- |3 or NEWTON |polynomial interpolation using the Newton algorithm |}
Processing of invalid X-Values (values outside the range min(XP)..max(XP)){| |- |value of INV |interpolation method |- |0 or EXTRAPOLATE |the value of Y is extrapolated, cannot be used with TYPE=LINEAR |- |1 or TRUNCATE |the X-value is "forced to be valid" |- |2 or LEAVE |no interpolation, Y is set to X |}