Using Simulink | ![]() ![]() |
The Graphical Merge Tool helps you to find and merge differences between versions of Simulink models, including models that contain Stateflow® charts. The Graphical Merge Tool simplifies collaborative development of models. For example, you and a colleague can each work on separate copies of a model and, when you are done, use the Graphical Merge Tool to combine the two versions.
Note You must have the Simulink Performance Tools option installed on your system to use the graphical merge tool. |
You can use the tool to compare and merge
Comparing Two Saved Models
The Graphical Merge Tool window (see The Graphical Merge Tool Window) appears along with a Select Second Model dialog box.
Use the Select model to compare to dialog box to select the other model to be compared. Simulink opens the second model, if it is not already open, and arranges the Graphical Merge Tool window and the two models, as shown in the following example.
Simulink also enlarges or shrinks the model block diagrams so that they fit entirely in their respective model windows.
Comparing a Model to Its Last Saved Version
If you have made changes to a model and have not yet saved the changes, you can compare the changed model to the last version of the model that you saved. To do this, select Model differences from the Simulink Tools menu. Then select Compare to Last Saved Model. Simulink creates a copy of the saved model in your system's temporary directory. It then opens the copy and arranges it side by side with the modified model and the tool window.
Comparing Source-Controlled Models
You can use the Graphical Merge Tool to compare versions of a model that you have stored in a source control system, such as RCS. To compare two versions that both reside in the version control system, select Compare versions... from the tool's File menu.
Note This item appears only if you have selected Source Control in the MATLAB Preferences dialog box. |
The Compare Versions dialog box appears.
Enter the name of the Simulink model for which you want to compare versions in the Simulink model field. Enter the version numbers of the two models in the two remaining fields and click Compare. Simulink opens the two versions of the model and arranges them side by side with the tool window for comparison.
You can also compare an in-memory version of a model with a version stored in the source control system. To do this, enter (Compare to version in memory)
in the Version 1 field of the dialog box.
![]() | Controlling S-Function Execution | The Graphical Merge Tool Window | ![]() |