主要内容

本页采用了机器翻译。点击此处可查看英文原文。

Simulink.CloneDetection.deleteExclusions

从克隆检测排除列表中移除组件

自 R2025a 起

说明

Simulink.CloneDetection.deleteExclusions(modelName,query) 从模型 modelName 的克隆检测排除列表中移除由 query 指定的组件(例如子系统或引用模型)。

示例

全部折叠

在进行克隆检测分析时,从排除列表中移除组件。

打开模型 ex_detect_clones

openExample('ex_detect_clones')

从克隆检测分析中排除模型 ex_detect_clones 中的子系统 SS2SS3

exclusionResults = Simulink.CloneDetection.addExclusions('ex_detect_clones',...
               {'ex_detect_clones/SS2','ex_detect_clones/SS3'},'Block to be removed later.')
exclusionResults =

  struct with fields:

    AddedExclusions: [1×2 struct]
    FailedExclusions: []

有关详细信息,请参阅从克隆检测分析中排除 Subsystem 块

从排除列表中移除子系统 SS2

Simulink.CloneDetection.deleteExclusions('ex_detect_clones',...
                  {'ex_detect_clones/SS2','ex_detect_clones/SS3'})

Simulink.CloneDetection.deleteExclusions 从克隆检测分析中排除子系统 SS2

从克隆检测排除列表中移除该查询。

打开 ex_detect_clones

openExample('ex_detect_clones')

从克隆检测分析中排除模型 ex_detect_clones 中的虚拟子系统。

exclusionResults = Simulink.CloneDetection.addExclusions('ex_detect_clones',...
           {'BlockType','Subsystem','IsSubsystemVirtual','On'},'Virtual subsystems excluded.')
exclusionResults =

  struct with fields:

    AddedExclusions: [1×1 struct]
    FailedExclusions: []

有关详细信息,请参阅使用特定准则排除模块

从排除列表中移除查询 {'BlockType','Subsystem','IsSubsystemVirtual','On'}

Simulink.CloneDetection.deleteExclusions('ex_detect_clones',...
              {'BlockType','Subsystem','IsSubsystemVirtual','On'})

Simulink.CloneDetection.deleteExclusions 删除了从克隆检测分析中排除虚拟子系统的查询。该函数能够处理 find_system 函数支持的查询。

输入参数

全部折叠

要从中移除排除项的模型,指定为字符向量或字符串数组。

示例: 'mymodel'

数据类型: char | string

要从克隆检测分析中排除的块或查询,以字符向量的元胞数组形式指定。

示例: {'Subsystem1','Subsystem2'}

示例: {'BlockType','Subsystem','IsSubsystemVirtual','On'}

数据类型: cell

替代功能

克隆检测排除编辑器

您还可以使用克隆检测排除编辑器删除排除项。要打开模型的克隆检测排除编辑器,请右键点击子系统或 Model 模块,然后选择 识别建模克隆 > 打开克隆检测排除编辑器。在“克隆检测排除编辑器”对话框中,选择要删除的排除项,然后点击删除排除行按钮 。有关详细信息,请参阅从克隆检测中排除组件

版本历史记录

在 R2025a 中推出