Accelerating the pace of engineering and science

# Documentation Center

• Trial Software
• Product Updates

# PS Lookup Table (1D)

Approximate one-dimensional function using specified lookup method

## Library

Physical Signals/Lookup Tables

## Description

The PS Lookup Table (1D) block computes an approximation to some function y=f(x) given data vectors x and y. Both the input and the output are physical signals.

 Note   To map two physical signal inputs to an output, use the PS Lookup Table (2-D) block.

The length of the x and y data vectors provided to this block must match. Also, the x data vector must be strictly increasing (i.e., the value of the next element in the vector is greater than the value of the preceding element).

You define the lookup table by specifying the Vector of input values parameter as a 1-by-n vector and the Vector of output values parameter as a 1-by-n vector. The block generates output based on the input values 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

Specify the vector of input values as a one-dimensional array. The input values vector must be strictly increasing. The values can be nonuniformly spaced.

Vector of output values

Specify the vector of output values as a one-dimensional array. The output values vector must be of the same size as the input values vector.

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 linear function.

• Cubic — Uses the Piecewise Cubic Hermite Interpolation Polinomial (PCHIP). For more information, see [1] and the pchip MATLAB® function.

• Spline — Uses the cubic spline interpolation algorithm described in [2].

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 end of the range. That is, the block uses the first and second specified output values if the input value is below the specified range, and the two last specified output values if the input value is above the specified range.

• From last point — Uses the last specified output value at the appropriate end of the range. That is, the block uses the last specified output value for all input values greater than the last specified input argument, and the first specified output value for all input values less than the first specified input argument.

## Ports

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

## References

[1] D. Kahaner, Cleve Moler, Stephen Nash, Numerical Methods and Software, Prentice Hall, 1988

[2] 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

## See Also

PS Lookup Table (2D)

Was this topic helpful?