If you have Simulink® Report Generator™ software, you can compare XML text files from Simulink models.
You can select a pair of Simulink models to compare their XML files. You can use models from any version of Simulink. The XML comparison tool produces a comparison report based on the SLX files. You can use the report to explore the differences, view the changes highlighted in the original models, and merge differences.
You can access the XML comparison tool from:
The MATLAB® Current Folder browser context menu
The MATLAB Comparison Tool
The MATLAB command line
The Simulink Editor Analysis menu
The Simulink Project Modified Files view
The Simulink Report Generator XML comparison functionality is an extension of the MATLAB Report Generator XML comparison feature.
You can use the XML comparison tool with both model file formats,
SLX and MDL. If the selected files are
the XML comparison tool first exports the
to SLX files in a temporary directory. The XML comparison tool then
produces a comparison report based on the SLX files.
For more information on creating reports, see Select Simulink Models for XML Comparison.
You can display XML comparison reports in the MATLAB Comparison Tool. The comparison tool processes the output of the XML comparison into an interactive report with links that you can click to reverse annotate from the XML tag comparison to the corresponding Simulink models. "Reverse annotation" means when you click items in the report, Simulink Report Generator displays the corresponding items highlighted in the original models, as shown in the following example.
The XML comparison report shows a hierarchical view of the portions of the two XML files that differ. The report does not show sections of the files that are identical.
If the files are identical you see a message reporting there are no differences.
If files have not been saved, you see an error message informing you that you must save modified or newly created models before running an XML comparison.
Note: It might not be possible for the analysis to detect matches between previously corresponding sections of files that have diverged too much.
Change detection in the Chawathe analysis is based on a scoring algorithm. Items match if their Chawathe score is above a threshold. The Simulink Report Generator implementation of Chawathe's algorithm uses a comparison pattern that defines the thresholds assigned to particular node types (e.g., "block"). For more information, see How the Matching Algorithm Works (MATLAB Report Generator).
For more information on using the report, see Compare Simulink Model XML Files.
To control reverse annotation, see Display Items in Original Models.
To merge differences, see Merge Simulink Models from the Comparison Report.
For more information about the Comparison Tool, see Comparing Files and Folders (MATLAB).