Main Content

Approximate one-dimensional function using specified lookup method

**Library:**Simscape / Foundation Library / Physical Signals / Lookup Tables

The PS Lookup Table (1D) block computes an
approximation to some function `f=f(x)`

given data vectors
`x`

and `f`

. Both the input and the output are
physical signals.

The length of the `x`

and `f`

data vectors provided
to this block must match. Also, the `x`

data vector must be strictly
monotonic, either increasing or decreasing.

You define the lookup table by specifying the **Table grid vector**
parameter as a 1-by-`n`

vector (`x`

data vector) and
the **Table values** parameter as a 1-by-`n`

vector
(`f`

data vector). The block generates output based on the input
values using the selected interpolation and extrapolation methods. You have a choice of
two interpolation methods and two extrapolation methods. You also have an option for the
block to issue an error if the input signal value is outside the table grid vector
range.

Plotting a lookup table lets you visualize the data before simulating the model, to make sure that the table is correct. The plot reflects tabulated data specified for the block, as well as the selected interpolation and extrapolation options.

To plot the data, right-click the block in your model and, from the context menu,
select **Foundation Library** > **Plot
Table**. For more information, see Plot Lookup Tables.