Main Content

Export, Print, and Save Model Comparison Results

Save Printable Report

To save a printable version of a model comparison report:

  1. On the Comparison tab, select Publish and choose the report format: HTML, Word, or PDF.

    The Save dialog box opens, where you can choose to save a printable version of the model comparison report.

  2. Specify the filename and location for saving the report.


In R2023a: You can disable screenshots in comparison reports. Before you publish the comparison results as a printable report, in the Command Window, enter:

s = settings().comparisons.slx.DisplayReportScreenshots;
s.TemporaryValue = false;

If you apply filters to the comparison results, the report shows filtered results.

Alternatively, you can publish a comparison report to a file using the visdiff function.

Export Results to the Workspace

To export the comparison results to the MATLAB® base workspace,

  1. On the Comparison tab, select Publish > Workspace Variable.

    The Input Variable Name dialog box appears.

  2. Specify a name for the export object in the dialog and click OK. This action exports the results of the model comparison to an xmlcomp.Edits object in the workspace.

The xmlcomp.Edits object contains information about the comparison including file names, filters applied, and hierarchical nodes that differ between the two files.

To create an xmlcomp.Edits object at the command line without opening the Comparison Tool, enter:

Edits =,modelname_B) 

Property of xmlcomp.EditsDescription
FiltersArray of filter structure arrays. Each structure has two fields, Name and Value.
LeftFileNameFile name of left model.
LeftRootxmlcomp.Node object that references the root of the left tree.
RightFileNameFile name of right model.
RightRootxmlcomp.Node object that references the root of the right tree.
TimeSavedTime when results exported to the workspace.
VersionMathWorks® release-specific version number of xmlcomp.Edits object.
Property of xmlcomp.NodeDescription
ChildrenArray of xmlcomp.Node references to child nodes, if any.
EditedBoolean — If Edited = true then the node is either inserted or part of a modified matched pair.
NameName of node.
ParametersArray of parameter structure arrays. Each structure has two fields, Name and Value.
Parentxmlcomp.Node reference to parent node, if any.
PartnerIf matched, Partner is an xmlcomp.Node reference to the matched partner node in the other tree. Otherwise empty [].

See Also