Main Content

Fixed-Point Prelookup and Interpolation

This example shows some of the features of Prelookup and Interpolation Using Prelookup blocks.

  • Prelookup and Interpolation Using Prelookup blocks support both floating-point data types and fixed-point data types.

  • The algorithms that perform fraction calculation and evenly-spaced index search do not saturate. Therefore, the Prelookup block does not have a saturation parameter. PressCtrl+bto generate code for the example. Observe the saturation-free algorithms in the generated code.

  • Even if theSaturate on integer overflowparameter is checked, the algorithms that perform interpolation will saturate only when theIntermediate results data typecannot hold the intermediate results, or theOutput data typecannot hold the result. PressCtrl+bto generate code for the example model. Observe the saturation-free algorithms in the generated code.

  • Prelookup and Interpolation Using Prelookup blocks support all rounding modes, includingSimplestrounding mode. Double-click the blocks to open their dialogs and specify the rounding modes.

  • When evenly-spaced index search is used with breakpoints spaced apart by a power of two in Prelookup blocks, the division needed to calculate indices is optimized using an efficient shift operation in the generated code.

  • Simulink® always checks dimensional consistency between theBreakpoint dataparameter of the Prelookup block and theTable dataparameter of the Interpolation Using Prelookup block.

  • Prelookup and Interpolation Using Prelookup blocks support two different indexing conventions, specified by theUse last breakpoint for input at or above upper limitparameter in the Prelookup block and theValid index input may reach last indexparameter in the Interpolation Using Prelookup block. Simulink® always checks the consistency of indexing conventions between these blocks.