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:
Block | Changes | Enhancements |
---|---|---|
Lookup Table |
|
|
Lookup Table (2-D) |
|
|
Lookup Table (n-D) |
|
|
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
:
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 |
How to Update Your Model
To update your model to use current versions of the lookup table blocks, follow these steps:
Step | Action | Reason |
---|---|---|
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:
| 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) Block | Parameter Settings After Automatic Block Replacement | |
---|---|---|
Interpolation | Extrapolation | |
Interpolation-Extrapolation | Linear | Linear |
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 |
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 Warning | Recommended Action | What Happens for Automatic Block Replacement |
---|---|---|
The Lookup Method is
| Change the lookup method to one of the following options:
| The Lookup Method
changes to In the replacement block, this setting corresponds to:
You also see a message that explains possible numerical differences. |
The Lookup Method is
| 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
n-D Lookup Table | Prelookup | Interpolation Using Prelookup