重构模型
识别建模克隆件和模式以变换模型
使用模型变换器和克隆件检测器来重构模型,以改善模型组件化、可读性并支持重用。
使用模型变换器可以:
确定可转换为 Variant Source 或 Variant Subsystem 模块的建模模式。使用 Variant Subsystem 和 Variant Source 模块有助于提高模型在不同条件表达式(称为变体选择项)中的重用率。活动模型是根据所选的变体选择项而激活的固定结构和可变组件的组合。
标识符合消除条件的数据存储模块。消除数据存储模块可明确表现数据依存关系,从而提高模型的可读性。
识别哪些 n-D Lookup Table 模块可转换为共享 Prelookup 模块和多个 Interpolation 模块。这种转换可提高仿真效率。
识别在建模模式中可变换为单一 Interpolation Using Prelookup 模块的多个 Interpolation Using Prelookup 模块。这种变换可提高生成代码的效率。
使用克隆检测器可以:
识别克隆件并创建模型,用指向库中子系统模块的链接替换克隆件。用指向库模块的链接替换克隆件可以实现组件重用。
识别模型中的克隆并用子系统引用替换。
函数
类
App
主题
模型变换器
- Transform Model to Variant System
Use the Model Transformer tool to transform a model into a variant system. - Improve Model Readability by Eliminating Local Data Store Blocks
Use the Model Transformer tool to make data dependency explicit in a model by replacing data store blocks with either a direct signal line, a Delay block or a Merge block. - Improve Efficiency of Simulation by Optimizing Prelookup Operation of Lookup Table Blocks
Use the Model Transformer tool to convert multiple n-D Lookup Table blocks into shared Prelookup blocks and multiple Interpolation blocks. - Improve Code Efficiency by Merging Multiple Interpolation Using Prelookup Blocks
Use the Model Transformer tool to transform a modeling pattern with multiple Interpolation Using Prelookup blocks into a single Interpolation Using Prelookup block.
克隆件检测器
- Enable Component Reuse by Using Clone Detection
Use the Clone Detector app to replace subsystem clones with library blocks. - Replace Exact Clones with Subsystem Reference
Use the Clone Detector app to replace exact clones with subsystem reference blocks. - Detect and Replace Subsystem Clones Programmatically
Use the Clone Detection APIs to identify and replace subsystem clones in a model. - Find Clones Across the Model
Use the Clone Detector to identify and replace clones across the model.