Main Content

Update Lookup Table Blocks to New Versions

Comparison of Blocks with Current Versions

In R2011a, the following lookup table blocks were replaced with newer versions in the Simulink® library:

BlockChangesEnhancements

Lookup Table

  • Default integer rounding mode changed from Floor to Simplest

  • Support for the following features:

    • Specification of parameter data types different from input or output signal types

    • Reduced memory use and faster code execution for nontunable breakpoints with even spacing

    • Cubic-spline interpolation and extrapolation

    • Table data with complex values

    • Fixed-point data types with word lengths up to 128 bits

    • Specification of data types for fraction and intermediate results

    • Specification of index search method

    • Specification of diagnostic for out-of-range inputs

Lookup Table (2-D)

  • Default integer rounding mode changed from Floor to Simplest

  • Support for the following features:

    • Specification of parameter data types different from input or output signal types

    • Reduced memory use and faster code execution for nontunable breakpoints with even spacing

    • Cubic-spline interpolation and extrapolation

    • Table data with complex values

    • Fixed-point data types with word lengths up to 128 bits

    • Specification of data types for fraction and intermediate results

    • Specification of index search method

    • Specification of diagnostic for out-of-range inputs

  • Check box for Require all inputs to have the same data type now selected by default

Lookup Table (n-D)

  • Default integer rounding mode changed from Floor to Simplest

Compatibility of Models with Older Versions of Lookup Table Blocks

When you load existing models that contain the Lookup Table, Lookup Table (2-D), and Lookup Table (n-D) blocks, those versions of the blocks appear. The current versions of the lookup table blocks appear only when you drag the blocks from the Simulink Library Browser into new models.

If you use the add_block function to add the Lookup Table, Lookup Table (2-D), or Lookup Table (n-D) blocks to a model, those versions of the blocks appear. If you want to add the current versions of the blocks to your model, change the source block path for add_block:

BlockOld Block PathNew Block Path
Lookup Table simulink/Lookup Tables/Lookup Tablesimulink/Lookup Tables/1-D Lookup Table
Lookup Table (2-D)simulink/Lookup Tables/Lookup Table (2-D)simulink/Lookup Tables/2-D Lookup Table
Lookup Table (n-D)simulink/Lookup Tables/Lookup Table (n-D)simulink/Lookup Tables/n-D Lookup Table

How to Update Your Model

To update your model to use current versions of the lookup table blocks, follow these steps:

StepActionReason
1

Run the Upgrade Advisor.

Identify blocks that do not have compatible settings with the 1-D Lookup Table and 2-D Lookup Table blocks.

2

For each block that does not have compatible settings:

  • Decide how to address each warning.

  • Adjust block parameters as needed.

Modify each Lookup Table or Lookup Table (2-D) block to ensure compatibility with the current versions.

3

Repeat steps 1 and 2 until you are satisfied with the results of the Upgrade Advisor check.

Ensure that block replacement works for the entire model.

After block replacement, the block names that appear in the model remain the same. However, the block icons match the ones for the 1-D Lookup Table and 2-D Lookup Table blocks. For more information about the Upgrade Advisor, see Model Upgrades.

What to Expect from the Model Advisor Check

The Model Advisor check groups all Lookup Table and Lookup Table (2-D) blocks into three categories:

  • Blocks that have compatible settings with the 1-D Lookup Table and 2-D Lookup Table blocks

  • Blocks that have incompatible settings with the 1-D Lookup Table and 2-D Lookup Table blocks

  • Blocks that have repeated breakpoints

Blocks with Compatible Settings

When a block has compatible parameter settings, automatic block replacement can occur without backward incompatibilities.

Lookup Method in the Lookup Table or Lookup Table (2-D) BlockParameter Settings After Automatic Block Replacement
InterpolationExtrapolation
Interpolation-ExtrapolationLinearLinear
Interpolation-Use End ValuesLinearClip
Use Input BelowFlatNot applicable

Depending on breakpoint spacing, one of two index search methods can apply.

Breakpoint Spacing in the Lookup Table or Lookup Table (2-D) BlockIndex Search Method After Automatic Block Replacement
Not evenly spacedBinary search
Evenly spaced and tunableA prompt appears, asking you to select Binary search or Evenly spaced points.
Evenly spaced and not tunable

Blocks with Incompatible Settings

When a block has incompatible parameter settings, the Model Advisor shows a warning and a recommended action, if applicable.

  • If you perform the recommended action, you can avoid incompatibility during block replacement.

  • If you use automatic block replacement without performing the recommended action, you might see numerical differences in your results.

Incompatibility WarningRecommended ActionWhat Happens for Automatic Block Replacement

The Lookup Method is Use Input Nearest or Use Input Above. The replacement block does not support these lookup methods.

Change the lookup method to one of the following options:

  • Interpolation - Extrapolation

  • Interpolation - Use End Values

  • Use Input Below

The Lookup Method changes to Interpolation - Use End Values.

In the replacement block, this setting corresponds to:

  • Interpolation set to Linear

  • Extrapolation set to Clip

You also see a message that explains possible numerical differences.

The Lookup Method is Interpolation - Extrapolation, but the input and output are not the same floating-point type. The replacement block supports linear extrapolation only when all inputs and outputs are the same floating-point type.

Change the extrapolation method or the port data types of the block.

The block uses small fixed-point word lengths, so that interpolation uses only one rounding operation. The replacement block uses two rounding operations for interpolation.

None

You see a message that explains possible numerical differences.

Blocks with Repeated Breakpoints

When a block has repeated breakpoints, the Model Advisor recommends that you change the breakpoint data and rerun the check. You cannot perform automatic block replacement for blocks with repeated breakpoints.

See Also

| |

Related Topics