How to handle visdiff for Simulink models per script?
8 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!