| Simulink® | ![]() |
Lookup Tables

The Interpolation Using Prelookup block is intended for use with the Prelookup block. The Prelookup block calculates the index and interval fraction that specifies how its input value relates to the breakpoint data set. You feed the resulting index and fraction values into an Interpolation Using Prelookup block to interpolate an n-dimensional table. This combination of blocks performs the equivalent operation that a single instance of the Lookup Table (n-D) block performs. However, the Prelookup and Interpolation Using Prelookup blocks offer greater flexibility that can result in more efficient simulation performance.
To use this block, you must define a set of output values as the Table data parameter. In normal use, these table values correspond to the breakpoint data sets specified in Prelookup blocks. The Interpolation Using Prelookup block generates its output by looking up or estimating table values based on the index and interval fraction values (denoted on the block as k and f, respectively) fed into the block by each Prelookup block:
If the inputs match the values of indices specified in breakpoint data sets, the Interpolation Using Prelookup block outputs the table value at the intersection of the row, column, and higher dimension breakpoints.
If the inputs do not match the values of indices specified in breakpoint data sets, the Interpolation Using Prelookup block generates output by interpolating appropriate table values. If the inputs are beyond the range of breakpoint data sets, the Interpolation Using Prelookup block can extrapolate its output value.
The Interpolation Using Prelookup block can perform interpolation on a portion of its table. The Number of sub-table selection dimensions parameter lets you specify that interpolation occur only on a subset of its Table data parameter. For example, if your 3-D table data constitutes a stack of 2-D tables to be interpolated, set the Number of sub-table selection dimensions parameter to 1. The block displays an input port (labeled as sel) used to select and interpolate the 2-D tables.
The Interpolation Using Prelookup block accepts real signals of any numeric data type supported by Simulink software, except Boolean. The Interpolation Using Prelookup block supports fixed-point data types.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.
The Main pane of the Interpolation Using Prelookup block dialog appears as follows:

The number of dimensions that the Table data parameter must have. This determines the number of independent variables for the table and hence the number of inputs to the block. Enter an integer between 1 and 30 into this field.
The table of output values. During simulation, the matrix size must match the dimensions defined by the Number of table dimensions parameter. But note that during block diagram editing, you can enter either an empty matrix (specified as []) or an undefined workspace variable as the Table data parameter. This allows you to postpone specifying a correctly dimensioned matrix for the Table data parameter and continue editing the block diagram. For information about how to construct multidimensional arrays in MATLAB, see Multidimensional Arrays in the MATLAB Programming Fundamentals documentation.
Note At runtime, the Interpolation Using Prelookup block converts the data type of its Table data parameter to that of its output. |
Click the Edit button to open the Lookup Table Editor (see Lookup Table Editor in the Simulink documentation).
None - Flat or Linear. See Interpolation Methods in the Simulink documentation for more information.
None - Clip or Linear. See Extrapolation Methods in the Simulink documentation for more information. The Extrapolation method parameter is visible only if you select Linear as the Interpolation method parameter.
Note The Interpolation Using Prelookup block does not support Linear extrapolation if its input or output signals specify integer or fixed-point data types. |
Specifies whether to produce a warning or error message if the input is out of range. The options are
None — the default, no warning or error message
Warning — display a warning message in the MATLAB Command Window and continue the simulation
Error — halt the simulation and display an error message in the Simulation Diagnostics Viewer
Specifies whether Real-Time Workshop software generates code that checks the validity of the index values fed to this block.
Specifies how the index and interval fraction inputs to the block (labeled respectively as k and f on the block) access the last elements of the n-dimensional table specified by the Table data parameter. If enabled, the block returns the value of the last element in a particular dimension of its table when k indexes the last table element in the corresponding dimension and f is 0. If disabled, the block returns the value of the last element in a particular dimension of its table when k indexes the next-to-last table element in the corresponding dimension and f is 1. Note that index values are zero-based.
This parameter is visible only if the Interpolation method specifies Linear and the Extrapolation method is None - Clip.
Note If you enable the Valid index input may reach last index parameter for an Interpolation Using Prelookup block, you must also enable the Use last breakpoint for input at or above upper limit parameter for all Prelookup blocks that feed it. This allows the blocks to use the same indexing convention when accessing the last elements of their Breakpoint data and Table data parameters. |
Specifies the number of dimensions of the subtable used to compute this block's output. Specify 0 (the default) to interpolate the entire table, effectively disabling subtable selection.
Specify the time interval between samples. To inherit the sample time, set this parameter to -1. See Specifying Sample Time in the Simulink documentation for more information.
The Signal Attributes pane of the Interpolation Using Prelookup block dialog appears as follows:

Specify the minimum value that the block should output. The default value, [], is equivalent to -Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
Specify the maximum value that the block should output. The default value, [], is equivalent to Inf. Simulink software uses this value to perform:
Parameter range checking (see Checking Parameter Values)
Simulation range checking (see Checking Signal Ranges)
Automatic scaling of fixed-point data types
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.
Select the rounding mode for fixed-point operations. For more information, see Rounding in the Simulink Fixed Point User's Guide.
Block parameters such as Table data are always rounded to the nearest representable value. To control the rounding of a block parameter, enter an expression using a MATLAB rounding function into the mask field.
Direct Feedthrough | Yes |
Sample Time | Specified in the Sample time parameter |
Scalar Expansion | Yes |
Dimensionalized | Yes |
Zero Crossing | No |
![]() | Integrator | Interval Test | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |