Using Simulink | ![]() ![]() |
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 PreLook-Up Index Search block calculates the indices and interval fractions for the input value in the Breakpoint data parameter. By using this combination of blocks, multiple Interpolation (n-D) blocks can be ed by one set of PreLook-Up Index Search blocks. In models that have many interpolation blocks simulation performance 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 PreLook-Up 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 represent's the input value's normalized position between the index and the next index value.
For example, if the breakpoint data is:
[ 0 5 10 20 50 100 ]
and the input value u is 55, the (index, fraction) pair will be (4, 0.1), denoted as k and f on the block icon. Note that the index value is zero-based.
Data Type Support
A PreLook-Up 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
Breakpoint data
Index search method
Binary search, evenly spaced points, or linear search. Use linear search in combination with Begin index search using previous index result for higher performance than a binary search when the input values do not change much from one time step to the next. For large breakpoint sets ,a linear search can be very slow if the input value changes by more than a few intervals from one time step to the next.
Begin index search using previous index result
Check this option if you want the block to start its search using the index that was found on the previous time step. For inputs that change slowly with respect to the interval size, you may realize a large performance gain.
Output only the index
If this block is not being used to feed an Interpolation (n-D) using PreLook-Up block, the interval fraction output can be dropped and the resulting index value output is a uint32
instead.
Process out of range input
Clip to Range or Linear Extrapolation.
Action for out of range input
Characteristics
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving blocks |
Scalar Expansion |
Yes |
Dimensionalized |
Yes |
Zero Crossing |
No |
![]() | Polynomial | Product | ![]() |