Using Simulink | ![]() ![]() |
Perform piecewise linear mapping of the input.
Library
Description
The Look-Up Table block maps an input to an output using linear interpolation of the values defined in the block's parameters.
You define the table by specifying (either as row or column vectors) the Vector of input values and Vector of output values parameters. The block produces an output value by comparing the block input with values in the input vector:
To map two inputs to an output, use the Look-Up Table (2-D) block. For more information, see Look-Up Table (2-D)
.
To create a table with step transitions, repeat an input value with different output values. For example, these input and output parameter values create the input/output relationship described by the plot that follows:
Vector of input values: [-2 -1 -1 0 0 0 1 1 2] Vector of output values: [-1 -1 -2 -2 1 2 2 1 1]
![]()
This example has three step discontinuities: at u = -1, 0, and +1.
When there are two points at a given input value, the block generates output according to these rules:
The Look-Up Table block icon displays a graph of the input vector versus the output vector. When a parameter is changed on the block's dialog box, the graph is automatically redrawn when you press the Apply or Close button.
Data Type Support
A Look-Up Table block accepts and outputs signals of type double
.
Parameters and Dialog Box
Characteristics
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving block |
Scalar Expansion |
No |
Dimensionalized |
Yes |
Zero Crossing |
No |
![]() | Logical Operator | Look-Up Table (2-D) | ![]() |