Main Content

Simulink.CloneDetection.findClones

Find clones in a model

Description

cloneResults = Simulink.CloneDetection.findClones(model) finds and returns subsystem clones for a specified model.

cloneResults = Simulink.CloneDetection.findClones(model,cloneDetectionSettings) uses the conditions specified in a cloneDetectionSettings object.

Examples

collapse all

This example shows how to execute findClones function and store the results to cloneResults object.

cloneResults = Simulink.CloneDetection.findClones('ex_clone_detection')

cloneResults =

  Results with properties:

    Clones: [1×1 struct]

cloneResults.Clones = 

  Results with properties:

        Summary: [1×1 struct]
    CloneGroups: [1×2 struct]

This example shows how to execute findClones function using the customised settings specified in cloneDetectionSettings object and change the value of property ParamDifferenceThreshold to zero.

cloneDetectionSettings = Simulink.CloneDetection.Settings();
cloneDetectionSettings.ParamDifferenceThreshold = 0; 

cloneResults = Simulink.CloneDetection.findClones('ex_clone_detection', cloneDetectionSettings)

cloneResults =

  Results with properties:

    Clones: [1×1 struct]

Input Arguments

collapse all

Model name, specified as a character vector.

Clone Detection Settings, specified as a Simulink.CloneDetection.Settings object.

Output Arguments

collapse all

Identified subsystem clones, returned as a Simulink.CloneDetection.Results object.

Introduced in R2021a