| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
The second stage of a table lookup operation involves generating outputs that correspond to the supplied inputs. If the inputs match the values of indices specified in breakpoint data sets, the block outputs the corresponding values. However, if the inputs fail to match index values in the breakpoint data sets, Simulink estimates the output. In the block parameter dialog box, you can specify how to compute the output in this situation. The available lookup methods are described in the following sections.
When an input falls between breakpoint values, the block interpolates the output value using neighboring breakpoints. Most lookup table blocks have the following interpolation methods available:
None (Flat) — Disables interpolation and uses the rounding operation titled Use Input Below. For more information, see Rounding Methods.
Linear interpolation — Fits a line between the adjacent breakpoints, and returns the point on that line corresponding to the input.
Cubic spline interpolation — Fits a cubic spline to the adjacent breakpoints, and returns the point on that spline corresponding to the input.
Note Blocks such as the Lookup Table Dynamic block do not allow you to choose an interpolation method. The Interpolation-Extrapolation option in the Lookup Method field of its block parameter dialog box performs linear interpolation. |
Each interpolation method includes a trade-off between computation time and the smoothness of the result. Although rounding is quickest, it is the least smooth. Linear interpolation is slower than rounding but generates smoother results, except at breakpoints where the slope changes. Cubic spline interpolation is the slowest but produces the smoothest results.
When an input falls outside the range of a breakpoint data set, the block extrapolates the output value from a pair of values at the end of the breakpoint data set. Most lookup table blocks have the following extrapolation methods available:
None (Clip to Range) or (Use End Values) — Disables extrapolation and returns the table data corresponding to the end of the breakpoint data set range.
Linear extrapolation — Fits a line between the first or last pair of breakpoints, depending if the input is less than the first or greater than the last breakpoint, respectively. This method returns the point on that line corresponding to the input.
Cubic spline extrapolation — Fits a cubic spline to the first or last pair of breakpoints, depending if the input is less than the first or greater than the last breakpoint, respectively. This method returns the point on that spline corresponding to the input.
Note Blocks such as the Lookup Table Dynamic block do not allow you to choose an extrapolation method. The Interpolation-Extrapolation option in the Lookup Method field of its block parameter dialog box performs linear extrapolation. |
In addition to these methods, some lookup table blocks, such as the Lookup Table (n-D) block, allow you to select an action to perform when encountering situations that require extrapolation. For instance, you can specify that Simulink generate either a warning or an error when the lookup table inputs are outside the ranges of the breakpoint data sets. To specify such an action, select it from the Action for out-of-range input list on the block parameter dialog box.
If an input falls between breakpoint values or outside the range of a breakpoint data set and you do not specify interpolation or extrapolation, the block rounds the value to an adjacent breakpoint and returns the corresponding output value. Most lookup table blocks let you select one of the following rounding methods:
Use Input Nearest — Returns the output value corresponding to the nearest input value.
Use Input Below — Returns the output value corresponding to the breakpoint value that is immediately less than the input value. If no breakpoint value exists below the input value, it returns the breakpoint value nearest the input value.
Use Input Above — Returns the output value corresponding to the breakpoint value that is immediately greater than the input value. If no breakpoint value exists above the input value, it returns the breakpoint value nearest the input value.
Suppose the Lookup Table Dynamic block accepts a vector of breakpoint data given by [-5:5] and a vector of table data given by sinh([-5:5]).

The Lookup Table Dynamic block outputs the following values when using the specified lookup methods and inputs.
| Lookup Method | Input | Output | Comment |
|---|---|---|---|
Interpolation- | 1.4 | 2.156 | N/A |
5.2 | 83.59 | N/A | |
Interpolation- | 1.4 | 2.156 | N/A |
5.2 | 74.2 | The block uses the value for sinh(5.0). | |
Use Input Above | 1.4 | 3.627 | The block uses the value for sinh(2.0). |
5.2 | 74.2 | The block uses the value for sinh(5.0). | |
Use Input Below | 1.4 | 1.175 | The block uses the value for sinh(1.0). |
-5.2 | -74.2 | The block uses the value for sinh(-5.0). | |
Use Input Nearest | 1.4 | 1.175 | The block uses the value for sinh(1.0). |
![]() | Characteristics of Lookup Table Data | Lookup Table Editor | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |