You can compare XML text from files of the same name. To complete the operation, the XML 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 XML comparison tool creates a read-only copy of one model named modelname_TEMPORARY_COPY, and compares the resulting XML files.
Alternatively, you can run the comparison by renaming or copying one of the files.
All merge operations merge from left to right, so you cannot accidentally merge to a temporary copy. Merge operations on models with identical names copy changes from the left (temporary copy) model to the right model. If you swap sides, the report always places a new temporary copy on the left side of the report, so any merges change the original model file and never a temporary copy.
If one of the models is open when you try to compare XML files, 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 XML comparison tool can compare XML files from 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 in the Simulink documentation for more information.
If you want to automatically close open models of the same name when comparing XML files and not see the dialog box again, run these commands:
opt = slxmlcomp.options opt.setCloseSameNameModel(true)
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 opt.setCloseSameNameModel(false)