| Simulink® | ![]() |
Approximate one-dimensional function using dynamically specified table
Lookup Tables

The Lookup Table Dynamic block computes an approximation to some function y=f(x) given x, y data vectors. The lookup method can use interpolation, extrapolation, or the original values of the input.
The x data vector must be strictly monotonically increasing (i.e., the value of the next element in the vector is greater than the value of the preceding element) after conversion to the input's fixed-point data type. Note that due to quantization, the x data vector may be strictly monotonic in doubles format, but not so after conversion to a fixed-point data type.
Note Unlike the Lookup Table block, the Lookup Table Dynamic block allows you to change the table data without stopping the simulation. For example, you may want to automatically incorporate new table data if the physical system you are simulating changes. |
You define the lookup table by inputting the x and y table data to the block as 1-by-n vectors. To help reduce the ROM used by the code generated for this block, you can use different data types for the x table data and the y table data. However, these restrictions apply:
The y table data and the output vector must have the same sign, the same bias, and the same fractional slope.
The x table data and the x data vector must have the same sign, the same bias, and the same fractional slope. Additionally, the precision and range for the x data vector must be greater than or equal to the precision and range for the x table data.
The block generates output based on the input values using one of these methods selected from the Lookup Method parameter list:
Interpolation-Extrapolation — This is the default method; it performs linear interpolation and extrapolation of the inputs.
If a value matches the block's input, the output is the corresponding element in the output vector.
If no value matches the block's input, then the block performs linear interpolation between the two appropriate elements of the table to determine an output value. If the block input is less than the first or greater than the last input vector element, then the block extrapolates using the first two or last two points.
Interpolation-Use End Values — This method performs linear interpolation as described above but does not extrapolate outside the end points of the input vector. Instead, the end-point values are used.
Use Input Nearest — This method does not interpolate or extrapolate. Instead, the element in x nearest the current input is found. The corresponding element in y is then used as the output.
Use Input Below — This method does not interpolate or extrapolate. Instead, the element in x nearest and below the current input is found. The corresponding element in y is then used as the output. If there is no element in x below the current input, then the nearest element is found.
Use Input Above — This method does not interpolate or extrapolate. Instead, the element in x nearest and above the current input is found. The corresponding element in y is then used as the output. If there is no element in x above the current input, then the nearest element is found.
The Lookup Table Dynamic block accepts signals of any data type supported by Simulink® software, including fixed-point data types.
The Main pane of the Lookup Table Dynamic block dialog appears as follows:

Specify the lookup method.
The Signal Attributes pane of the Lookup Table Dynamic block dialog appears as follows:

Specify the output data type. You can set it to:
A rule that inherits a data type, for example, Inherit: Inherit via back propagation
The name of a built-in data type, for example, single
The name of a data type object, for example, a Simulink.NumericType object
An expression that evaluates to a data type, for example, float('single')
Click the Show data type assistant button
to display the Data
Type Assistant, which helps you set the Output
data type parameter.
See Specifying Block Output Data Types for more information.
Select to lock scaling of outputs. This parameter is visible only if you enter an expression for the Output data type parameter.
Rounding mode for the fixed-point output. For more information, see Rounding in the Simulink® Fixed Point™ User's Guide.
If selected, fixed-point overflows saturate.
For an example that illustrates the lookup methods supported by this block, see the example included in the Lookup Table block reference pages.
Direct Feedthrough | Yes |
Scalar Expansion | No |
Lookup Table, Lookup Table (2-D), Lookup Table (n-D)
![]() | Lookup Table (n-D) | Magnitude-Angle to Complex | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |