Simulink.CloneDetection.Results Class
Namespace: Simulink.CloneDetection
Description
Use an object of the Simulink.CloneDetection.Results
class to
analyze the results of the find clone operation.
Creation
Description
The Simulink.CloneDetection.findClones
function creates an object of the
Simulink.CloneDetection.Results
class when executed. You can
use this object as the input argument of the Simulink.CloneDetection.replaceClones
function.
Note
You should not write the
Simulink.CloneDetection.Results
object to avoid wrong
execution of replace clones function.
Properties
Clones
— Detected clone information
struct
Detected clone information, specified as a structure.
Summary
— Clone detection summary
struct
Number of CloneGroups
,
SimilarClones
,
ExactClones
and
PotentialReusePercentage
, returned as a
structure.
CloneGroups
— Number of clone groups
uint32
Number of identical clone patterns in the model, specified as a uint32 integer.
SimilarClones
— Number of similar clones
uint32
Number of similar clones in the model, specified as a uint32 integer
ExactClones
— Number of exact clones
uint32
Number of exact clones in the model, specified as a uint32 integer.
Clones
— Total number of clones
uint32
Total number of clones in the model, specified as a uint32 integer.
PotentialReusePercentage
— Percentage of reuse opportunity
struct
Percentage of reuse opportunity in the model, specified as a structure with these fields:
Overall
— Overall percentage of clones presentExact
— Percentage of exact clones presentSimilar
— Percentage of similar clones present
CloneGroups
— Group of clones considered as identical match
struct
Subsystems that are considered as clones, specified as a structure.
Name
— Clone group name
character vector
Name of the clone group, specified as a character vector.
Summary
— Clone group summary
struct
Summary of the clone group, specified as a structure with these fields:
ParameterDifferences
— List of differences in parametersClones
— Number of subsystem clones in a particular clone groupBlocksPerClone
— Number of block elements in the cloneCloneType
— Whether the clone is aSimilar
orExact
cloneBlockDifference
— Difference in block value
CloneList
— List of subsystem clones
array of character vectors
List of subsystem clones, specified as a structure with these fields:
Name
— Clone region namePatternBlocks
— List of blocks that form the clone patternDataTypeMatch
— Whether the inport data types of the library subsystem match inport data types of a clone in the model
ExceptionLog
— Log of exceptions and warnings
array of character vectors
The ExceptionLog
contains the exceptions and warnings
from find clones operation, specified as an array of character
vectors.
Examples
Analyze Results After Finding Clones in Model
This example shows how to analyze the results of a find clones operation. For an example model, see
ex_detect_clones
.The
Simulink.CloneDetection.findClones
function stores the information incloneResults
object.openExample('ex_detect_clones'); cloneResults = Simulink.CloneDetection.findClones('ex_detect_clones')
cloneResults = Results with properties: Clones: [1×1 struct] ExceptionLog: ''
cloneResults.Clones
struct with fields: Summary: [1×1 struct] CloneGroups: [1×2 struct]
View the summary of
cloneResults
.cloneResults.Clones.Summary
struct with fields: CloneGroups: 2 SimilarClones: 5 ExactClones: 0 Clones: 5 PotentialReusePercentage: [1×1 struct]
cloneResults.Clones.CloneGroups
1×2 struct array with fields: Name Summary CloneList
cloneResults.Clones.CloneGroups(1)
struct with fields: Name: 'Similar Clone Group 1' Summary: [1×1 struct] CloneList: {3×1 cell}
View the summary of first clone group.
cloneResults.Clones.CloneGroups(1).Summary
struct with fields: ParameterDifferences: [1×1 struct] Clones: 3 BlocksPerClone: 8 CloneType: 'Similar' BlockDifference: 1
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)