Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

重构模型

识别建模克隆件和模式以变换模型

使用模型变换器和克隆件检测器来重构模型,以改善模型组件化、可读性并支持重用。

使用模型变换器可以:

  • 确定可转换为 Variant Source 或 Variant Subsystem 模块的建模模式。使用 Variant SubsystemVariant Source 模块有助于提高模型在不同条件表达式(称为变体选择项)中的重用率。活动模型是根据所选的变体选择项而激活的固定结构和可变组件的组合。

  • 标识符合消除条件的数据存储模块。消除数据存储模块可明确表现数据依存关系,从而提高模型的可读性。

  • 识别哪些 n-D Lookup Table 模块可转换为共享 Prelookup 模块和多个 Interpolation 模块。这种转换可提高仿真效率。

  • 识别在建模模式中可变换为单一 Interpolation Using Prelookup 模块的多个 Interpolation Using Prelookup 模块。这种变换可提高生成代码的效率。

使用克隆检测器可以:

  • 识别克隆件并创建模型,用指向库中子系统模块的链接替换克隆件。用指向库模块的链接替换克隆件可以实现组件重用。

  • 识别模型中的克隆并用子系统引用替换。

函数

全部展开

mdltransformer打开模型变换器
Simulink.ModelTransform.CommonSourceInterpolation.identifyCandidatesIdentify eligible Interpolation Using Prelookup blocks to transform (自 R2021b 起)
Simulink.ModelTransform.CommonSourceInterpolation.refactorModelReplace Interpolation Using Prelookup blocks (自 R2021b 起)
clonedetection打开克隆检测器
Simulink.CloneDetection.findClonesFind clones in a model (自 R2021a 起)
Simulink.CloneDetection.replaceClonesReplace clones in a model (自 R2021a 起)
Simulink.CloneDetection.checkEquivalencyCheck equivalency of clone-replaced model and original model (自 R2021a 起)
Simulink.CloneDetection.highlightCloneHighlight clone in a Simulink model (自 R2021b 起)
Simulink.CloneDetection.generateReportGenerate clone detection report (自 R2023b 起)

全部展开

Simulink.ModelTransform.CommonSourceInterpolation.ResultsResults of search for eligible Interpolation Using Prelookup blocks (自 R2021b 起)
Simulink.ModelTransform.CommonSourceInterpolation.RefactorResultsRefactored model results (自 R2021b 起)
Simulink.CloneDetection.Settings Conditions for findClones function (自 R2021a 起)
Simulink.CloneDetection.ResultsResults of find clones (自 R2021a 起)
Simulink.CloneDetection.ReplacementConfigConditions for clone replacement function (自 R2021a 起)
Simulink.CloneDetection.ReplacementResultsResults of replace clones (自 R2021a 起)
Simulink.CloneDetection.EquivalencyCheckResultsResults of equivalency check (自 R2021a 起)

App

模型变换器Enable model transformation by identifying and refactoring the modelling patterns to optimize the models (自 R2019b 起)
克隆检测器通过标识和替换克隆,在模型中实现模型重构和子系统重用 (自 R2019b 起)

主题

模型变换器

克隆件检测器