Main Content

Simulink.CloneDetection.deleteExclusions

Remove component from clone detection exclusion list

Since R2025a

Description

Simulink.CloneDetection.deleteExclusions(modelName,query) removes components, such as subsystems or referenced models, specified by query from the clone detection exclusion list for the model modelName.

Examples

collapse all

Remove components from exclusion when performing clone detection analysis.

Open the model ex_detect_clones.

openExample('ex_detect_clones')

Exclude the subsystems SS2 and SS3 in the model ex_detect_clones from clone detection analysis.

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: []

For more information, see Exclude Subsystem Blocks from Clone Detection Analysis.

Remove the subsystem SS2 from exclusion list.

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

Simulink.CloneDetection.deleteExclusions removes the subsystem SS2 for excluding from clone detection analysis.

Remove query from the clone detection exclusion list.

Open the ex_detect_clones.

openExample('ex_detect_clones')

Exclude virtual subsystems in the model ex_detect_clones from clone detection analysis.

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

  struct with fields:

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

For more information, see Exclude Blocks Using Specific Criteria.

Remove the query {'BlockType','Subsystem','IsSubsystemVirtual','On'} from the exclusion list.

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

Simulink.CloneDetection.deleteExclusions removes the query for excluding virtual subsystems from clone detection analysis. The function is capable of handling queries that the function find_system supports.

Input Arguments

collapse all

Model to remove exclusions from, specified as a character vector or string array.

Example: 'mymodel'

Data Types: char | string

Blocks or query to be excluded from clone detection analysis, specified as a cell array of character vectors.

Example: {'Subsystem1','Subsystem2'}

Example: {'BlockType','Subsystem','IsSubsystemVirtual','On'}

Data Types: cell

Alternative Functionality

Clone Detection Exclusion Editor

You can also remove an exclusion by using the Clone Detection Exclusion Editor. To open the Clone Detection Exclusion Editor for a model, right-click a Subsystem or Model block and select Identify Modeling Clones > Open Clone Detection Exclusion Editor. In the Clone Detection Exclusion Editor dialog box, select the exclusion that you want to remove and click the Delete exclusion row button . For more information, see Exclude Components from Clone Detection.

Version History

Introduced in R2025a