Main Content

Comparing Models with Identical Names

You can compare model files of the same name. To complete the operation, the comparison tool copies one of the models to a temporary folder, because Simulink® cannot have two models of the same name in memory at the same time. The comparison tool creates a read-only copy of one model named modelname_TEMPORARY_COPY, and compares the resulting XML files.


When you use highlighting from the report, one of the models displayed is a temporary copy with a new name. The temporary copy is read-only, to avoid making changes that can be lost.

Alternatively, you can run the comparison by renaming or copying one of the files.

If one of the models is open when you try to compare them, a dialog box appears where you can click Yes to close the file and proceed, or No to abort. You must close open models before the comparison tool can compare two models with the same name. The problem requiring you to close the loaded model is called “shadowed files”. In some cases, another model with the same name might be in memory, but not visible. See Shadowed Files for more information.

If you want to automatically close open models of the same name when comparing them and not see the dialog box again, run these commands:

opt = slxmlcomp.options
This is persistent across MATLAB® sessions. To revert to default behavior and be prompted whether or not to close the open model every time, enter:
opt = slxmlcomp.options

If you open a comparison report from a project (for example, using Compare to Revision), the project handles files of the same name and does not prompt you to close models.