Next: , Previous: , Up: Internal Routines   [Contents][Index]

#### 15.5.617 table

```table(x, y [, index], xnew [, /all, /middle])```

`table` interpolates in table `y` vs. `x` at positions `xnew`. The first dimension of `x` and `y` specifies the entries in one interpolation table. Second and higher dimensions of `x` and `y` specify individual interpolation tables. `x` must be in ascending order in its first dimension. Dimensions shared between `x` and `y` must be equal. Variables are repeated to accomodate omitted dimensions. For example, if `x` has dimensions `[2,3]` and `y` dimensions `[2,3,4,2]` then `x` is repeated as needed to accomodate the third and fourth dimensions of `y` so that `x` effectively has the same dimensions as `y`.

If no `index` is specified, then keyword `/all` indicates that all values of `xnew` are to be used on each interpolation table. In that case, the result will have all expect the first of the (implied) dimensions of `x` and `y`, and all the dimensions of `xnew`, too.

If keyword `/all` is not specified, then each one-dimensional vector from `xnew` (e.g., `xnew`(*,2)) is applied to each next interpolation vector pair from `x` and `y` (e.g., `x`(*,2) and `y`(*,2)). In that case the second and higher dimensions of `xnew` must match the second and higher dimensions of `x` and `y`, and the result will have the same dimensions (real or implied) as `xnew`. For example, if `x` has dimensions `[2,3]`, `y` dimensions `[2,3,5]`, and `xnew` dimensions `[4,3]`, then the result will have dimensions `[4,3,5]`.

If `index` is specified, then it must be an array and each element of it determines which interpolation table (counting all dimensions of `x`, `y` except the first one) to use for the corresponding element of `xnew`. In that case, dimensions shared between `index` and `xnew` must be equal. Non-integer elements of `index` are treated with linear interpolation. The result gets all dimensions of the largest of `xnew` and `index`.

Keyword `/middle` (set by default) specifies that searching `x` for a value of `xnew` starts in the middle (and can then proceed either toward the beginning or the end of the interpolation table). If `/nomiddle` is specified, then searching starts at the beginning.

In earlier versions of LUX, a routine `polate` was available for linear interpolation. This older routine has now been superseded by `table`, and `polate` is now an alias of `table`.

Alias: polate