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
, 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 opt.setCloseSameNameModel(true)
opt = slxmlcomp.options opt.setCloseSameNameModel(false)
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.