Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# PS Lookup Table (2D)

Approximate two-dimensional function using specified lookup method

## Library

Physical Signals/Lookup Tables

## Description

The PS Lookup Table (2D) block computes an approximation to some function z=f(x,y) given the x, y, z data points. The two inputs and the output are physical signals.

The x and y data vectors must be strictly increasing (i.e., the value of the next element in the vector is greater than the value of the preceding element). The matrix size of the tabulated function values must match the dimensions defined by the input vectors.

You define the lookup table by specifying the Vector of input values along X-axis parameter as a 1-by-m vector of x data points, the Vector of input values along Y-axis parameter as a 1-by-n vector of y data points, and the Tabulated function values as an m-by-n matrix of z data points. The block works on Cartesian mesh, i.e., function values must be specified at vertices of a rectangular array. The block generates output based on the input grid lookup using the selected interpolation and extrapolation methods. You have a choice of three interpolation methods and two extrapolation methods.

## Dialog Box and Parameters

Vector of input values along X-axis

Specify the vector of input values along the x-axis as a 1-by-m array. The input values vector must be strictly increasing. The values can be nonuniformly spaced.

Vector of input values along Y-axis

Specify the vector of input values along the y-axis as a 1-by-n array. The input values vector must be strictly increasing. The values can be nonuniformly spaced.

Tabulated function values

Specify the output values as an m-by-n matrix, defining the function values at the input grid vertices. The matrix size must match the dimensions defined by the input vectors.

Interpolation method

Select one of the following interpolation methods for approximating the output value when the input value is between two consecutive grid points:

• Linear — Uses a bilinear interpolation algorithm, which is an extension of linear interpolation for functions in two variables. The method performs linear interpolation first in x-direction and then in y-direction.

• Cubic — Uses the bicubic interpolation algorithm described in [1].

• Spline — Uses the bicubic spline interpolation algorithm described in [1].

Extrapolation method

Select one of the following extrapolation methods for determining the output value when the input value is outside the range specified in the argument list:

• From last 2 points — Extrapolates using the linear method (regardless of the interpolation method specified) based on the last two output values at the appropriate grid location, similar to PS Lookup Table (1D) block.

• From last point — Uses the last specified output value at the appropriate grid location, similar to PS Lookup Table (1D) block..

## Ports

The block has two physical signal input ports and one physical signal output port.

## References

[1] W.H.Press, B.P.Flannery, S.A.Teulkolsky, W.T.Wetterling, Numerical Recipes in C: The Art of Scientific Computing, Cambridge University Press, 1992