# PS Lookup Table (2D)

Approximate two-dimensional function using specified lookup method

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

## Description

The PS Lookup Table (2D) block computes an
approximation to some function `f=f(x1,x2)`

given the
`x1`

, `x2`

, `f`

data points. The
two inputs and the output are physical signals.

You define the lookup table by specifying the **Table grid vector 1**
parameter (vector of data points along the first axis), the **Table grid vector
2** parameter (vector of data points along the second axis), and the
**2D array of table values** (array of output values). The block
works on Cartesian mesh, i.e., function values must be specified at vertices of a
rectangular array.

The `x1`

and `x2`

data vectors must be strictly
monotonic, either increasing or decreasing. The array size of the tabulated function
values must match the dimensions defined by the input vectors. That is, if the inputs
are a 1-by-`m`

vector and a 1-by-`n`

vector, supply an
`m`

-by-`n`

matrix of output values.

The block generates output based on the input grid lookup 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 any of the input signal values is outside the respective table grid vector range.

### Plotting Table Data

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.

## Ports

### Input

### Output

## Parameters

## Model Examples

## Extended Capabilities

## Version History

**Introduced in R2007a**