Export, Print, and Save Model Comparison Results
R2026bYou can save model comparison results as reports or workspace variables. If you have not yet run a comparison analysis, see Select Models to Compare.
To save your comparison results in a report, in the Comparison toolstrip, select Publish and choose the report format: HTML, Word, PDF or PDF/A. PDF/A comparison reports are not supported on Linux®.
Alternatively, you can publish a comparison report to a file using the visdiff function.
If you apply filters to the comparison results, the saved report contains only filtered results.
The report also shows side by side screenshots of the modified models. Starting in R2023a, you can disable screenshots in comparison reports. Before you publish the comparison results, in the Command Window, enter these commands.
s = settings().comparisons.slx.DisplayReportScreenshots; s.TemporaryValue = false;
To export the comparison results to the MATLAB® base workspace, in the Comparison toolstrip, select Publish > Save to Workspace and specify the variable name.
Saving the model comparison results as a workspace variable creates a
ModelDiffResults object in the workspace. The
ModelDiffResults object contains information about the comparison,
including file names, filters applied, and hierarchical nodes that differ between the two
files.
To create a ModelDiffResults object at the command line without opening
the Comparison Tool, enter this
command.
results = visdiff(modelname_A,modelname_B)