| Simulink Reference | ![]() |
First stage of high-performance constant or linear interpolation that performs index search and interval fraction calculation for input on a breakpoint set
Library
Description
The PreLookup Index Search block calculates the indices and interval fractions for the input value in the Breakpoint data parameter. By using this combination of blocks, you can replace multiple Interpolation (n-D) blocks with one set of PreLookup Index Search blocks. In models that have many interpolation blocks simulation performance can be greatly increased.
To use this block, you must define a set of breakpoint values. In normal use, this breakpoint data set corresponds to one dimension of a Table data parameter in an Interpolation (n-D) using PreLookup block. The block generates a pair of outputs for each input value by calculating the index of the breakpoint set element that is less than or equal to the input value and the resulting fractional value that is a number 0
f < 1 that represents the input value's normalized position between the index and the next index value for in-range input.
For example, if the breakpoint data is
and the input value u is 55, the (index, fraction) pair is (4, 0.1), denoted as k and f on the block. Note that the index value is zero-based.
Note
The interval fraction can be negative or greater than 1 for out-of-range input. See the documentation for the block's Process out of range input parameter for more information.
|
Data Type Support
The PreLookup Index Search block accepts signals of types double or single, but for any given block the inputs must all be of the same type. The Breakpoint data parameter must be of the same type as the inputs. The output data type is set to the input data type.
Parameters and Dialog Box
uint32 instead.
Clip to Range
0) and 0 for the interval fraction. If the input is greater than the last breakpoint, return the index of the next-to-the-last breakpoint and 1 for the interval fraction. For example, suppose the range is [1 2 3] and you select this option. Then, if the input is 0.5, the block returns [0 0]; if the input is 3.5, the block returns [1 1].
Linear Extrapolation
an interval fraction that represents the linear distance from the next-to-the-last breakpoint to the input. For example, suppose the range is [1 2 3] and you select this option. Then, if the input is 0.5, the block returns [0 -0.5]; if the input is 3.5, the block returns [1 1.5].
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).
Characteristics
| Direct Feedthrough |
Yes |
| Sample Time |
Inherited from driving blocks |
| Scalar Expansion |
Yes |
| Dimensionalized |
Yes |
| Zero Crossing |
No |
| Polynomial | Product | ![]() |
© 1994-2005 The MathWorks, Inc.