Main Content

Select Models to Compare

Use the Comparison Tool to review and merge differences between two model files on disk or between different revisions of the same file.

For information about opening the Comparison Tool from the files, project and branches browsers, see Open the Comparison Tool.

Tip

If you are using source control outside of MATLAB®, you can customize external source control tools to use MATLAB comparison and merge tools.

For instructions, see Customize External Source Control to Use MATLAB for Diff and Merge.

Compare Two Models on Disk

You assign a new hire a task to improve the readability of the mysimple_stats_block1.slx model. You share the model in an email attachment.

After finishing the task, the new hire shares the improved model mysimple_stats_block2.slx.

To compare the models on disk, use one of these methods.

  • On the Home tab, in the File section, click Compare. Specify the models you want to compare by using the browser or pasting the path to the model files.

  • In the Current Folder browser, select the two model files. Right-click and select Compare Selected Files/Folders.

  • In the Command Window, enter this command.

visdiff("mysimple_stats_block1.slx","mysimple_stats_block2.slx");

Compare Model to Revision

You assign a new hire a task to improve the readability of the mysimple_stats_block.slx model. The model is under Git™ source control.

After finishing the task, the new hire commits the changes to the repository.

To compare the two different model revisions, in the Current Folder browser, select the model file. Right-click and select Source Control > Compare to Revision.

Select the two revisions from the commit history and click Compare Selected.

See Also

|

Related Examples

More About