- Select two Simulink models at once (e.g. by holding down the CTRL key while selecting one file after another in the “Current Folder” pane of MATLAB) and right click on the selection. In the appeared menu, select “Compare Selected Files/Folders”.
- Alternatively, you may select one of the Simulink models, right click and select “Compare Against” > “Choose…”, then select the second Simulink model from the file browser in the “Selecting Files or Folders for Comparison” dialog box.
- Click on the “compare” button in the MATLAB tool-strip under the “File” section. In the “Selecting Files or Folders for Comparison” dialog box, use the file browser to select the two Simulink model files for comparison.
How can I compare differences between two Simulink models?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 6 Jan. 2017
Bearbeitet: MathWorks Support Team
am 19 Mai 2023
I have two versions of the same Simulink model, and I would like to automatically find the differences between them. How can I do this?
Akzeptierte Antwort
MathWorks Support Team
am 19 Mai 2023
Bearbeitet: MathWorks Support Team
am 19 Mai 2023
Since MATLAB R2017b, base Simulink comes with a Model Comparison feature, which will allow you to see a comparison of differences between two Simulink models. With the Comparison Tool, you can review as well as merge differences. You can use models from any version of Simulink. Use the Comparison Tool to explore the differences, view the changes highlighted in the original models, and merge differences. See the following documentation page for further information, as well as multiple examples on how to use Simulink Model Comparison:
There are three basic ways to initiate the comparison:
Note that for MATLAB R2017a and earlier, doing this kind of comparison requires to have "Simulink Report Generator" toolbox installed and licensed for. See the following documentation page for further information, as well as multiple examples on how to use Simulink Model Comparison. You can run the below command in MATLAB R2017a to view the documentation:
>> web(fullfile(docroot, 'rptgenext/ug/compare-simulink-model-xml-files.html'))
Unfortunately, there is no practical way to compare two Simulink models without using the Simulink Report Generator toolbox in R2017a and earlier. Without the toolbox, there is a workaround in which you may export the models first into XML files via the “save_system” function. The command to use has the following syntax:
>> save_system('model_name’, 'model_xml.xml','ExportToXML', true);
Then use any commercial software available to compare the two XML files. This is not recommended as small changes in your model could result in large changes in the XML file, and thus raw comparison could yield misleading results.
1 Kommentar
Eeshan Mitra
am 24 Apr. 2018
Hi Praveen
The ability to highlight all block differences at once was available in R2016b. However this is not available since R2017a, but may be implemented for future release again.
Regards
Eeshan
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!