How to handle visdiff for Simulink models per script?

조회 수: 11 (최근 30일)
Hannes Siegl
Hannes Siegl 2020년 9월 23일
댓글: mawa 2022년 8월 31일
I want to call the compare tool for Simulink per script, do a diff with a filter applied and store the output to the workspace in order to do some statistics.
comp_bat = visdiff('Mod1', 'Mod2')
The return value of comp is of class SimulinkModelComparison (methods: delete, filter, publish).
comp_bat =
SimulinkModelComparison with properties:
Left: 'Mod1.slx'
Right: 'Mod2.slx'
I can publish that to html or docx, but there is neither an option for publish to workspace (as it already is?) nor to define a filter.
If I run the comparison in the GUI, there is the possibility to set the filters, and to do the diff, and to publish to workspace.
However, the workspace variable is of class Edits (methods: none) now.
comp_gui =
Edits with properties:
Filters: [1×3 struct]
LeftFileName: 'Mod1.slx'
LeftRoot: [1×1 xmlcomp.Node]
RightFileName: 'Mod2.slx'
RightRoot: [1×1 xmlcomp.Node]
TimeSaved: '23-Sep-2020 15:43:34'
Version: '2.0'
The data which I want to evaluate is stored in LeftRoot and RightRoot.
So basically, I need to define the filter, set it in SimulinkModelComparison class and transform it somehow to Edits class.

채택된 답변

Manas Meena
Manas Meena 2020년 10월 1일
In my understanding you want to edit the filters using visdiff , publish the results and export the results to the workspace.
For changing the filters via visdiff you may do the following :
comparison = visdiff(modelname1,modelname2);
filter(comparison, 'unfiltered');
Supported filters are: 'unfiltered' – removes all filtering from the comparison, or 'default' – default filtering strategy for comparisons.
Then you can use the publish function to view the results as an HTML file
To export results to the workspace and to learn more about the xmlcomp.Edits object refer to the following link:
For examples about Simulink Model Comparison you can refer to this link:
  댓글 수: 3
Manas Meena
Manas Meena 2020년 10월 1일
This functionality is not currently supported, I have heard that this issue is known and the concerned parties may be investigating further.
mawa
mawa 2022년 8월 31일
@Manas Meena has anything happened regarding unsupported functions?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by