How to handle visdiff for Simulink models per script?

18 ビュー (過去 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 Center および File ExchangeInteractive Model Editing についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by