|On this page…|
In R2011a, the following lookup table blocks were replaced with newer versions in the Simulink® library:
Lookup Table (2-D)
Lookup Table (n-D)
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:
|Block||Old Block Path||New Block Path|
|Lookup Table||simulink/Lookup Tables/Lookup Table||simulink/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|
To update your model to use current versions of the lookup table blocks, follow these steps:
Run this Model Advisor check: By Product > Simulink > Check model, local libraries, and referenced models for known upgrade issues requiring compile time information.
Identify blocks that do not have compatible settings with the 1-D Lookup Table and 2-D Lookup Table blocks.
For each block that does not have compatible settings:
Modify each Lookup Table or Lookup Table (2-D) block to ensure compatibility with the current versions.
Repeat steps 1 and 2 until you are satisfied with the results of the Model Advisor check.
Ensure that block replacement works for the entire model.
Run the slupdate function on your model.
Perform block replacement with the 1-D Lookup Table and 2-D Lookup Table blocks.
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 Model Advisor, see Consult the Model Advisor in the Simulink documentation.
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
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) Block||Parameter Settings After Automatic Block Replacement|
|Interpolation-Use End Values||Linear||Clip|
|Use Input Below||Flat||Not applicable|
Depending on breakpoint spacing, one of two index search methods can apply.
|Breakpoint Spacing in the Lookup Table or Lookup Table (2-D) Block||Index Search Method After Automatic Block Replacement|
|Not evenly spaced||Binary search|
|Evenly spaced and tunable||A prompt appears, asking you to select Binary search or Evenly spaced points.|
|Evenly spaced and not tunable|
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 Warning||Recommended Action||What 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:
The Lookup Method changes to Interpolation - Use End Values.
In the replacement block, this setting corresponds to:
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.
You see a message that explains possible numerical differences.
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.