Simulink Reference    
Prelook-Up Index Search

First stage of high-performance constant or linear interpolation that performs index search and interval fraction calculation for input on a breakpoint set

Library

Look-Up Tables

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, you can replace multiple Interpolation (n-D) blocks with one set of PreLook-Up 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 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 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 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

The set of numbers to search.

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

Select 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 can 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

Specifies how to handle out-of-range input. Options include:

Action for out of range input

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 Simulink Diagnostic Viewer).

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving blocks
Scalar Expansion
Yes
Dimensionalized
Yes
Zero Crossing
No


  Polynomial Product