visdiff

Syntax

Description

visdiff('filename1', 'filename2') opens
the Comparison
Tool and presents the differences between the two files
or folders. Either ensure that the two files or folders appear on
the MATLAB® path, or provide the full path for each file or folder. You can compare files or any combination
of folders, zip files, Simulink® manifests or models.

If you have Simulink Report Generator™ software,
you can select a pair of Simulink models to compare XML text
files generated from them. For information, see Model Comparison.

visdiff('filename1',
'filename2', 'type') opens
the Comparison Tool and presents the differences between the two files
using the specified comparison type. type can
be 'text' or 'binary'. If you
do not specify type, visdiff creates
the default comparison type for your selected files. The type option
does not apply when comparing folders.

If there are multiple
comparison types available for your selections (e.g., text, binary,
file list, or XML comparison), you can create a new comparison and
choose a different comparison type.

In the Comparison Tool, click the New comparison button.

The dialog box Select Files or Folders for Comparison opens
and shows your previous comparison selections in the drop-down lists.

Compare Two Folders or Zip Files

You can perform file list comparisons for any combinations of
folders and zip files. To view an example folder comparison and instructions
for using the report features, see Comparing Folders and Zip Files.

Compare Files and Specify Type

To compare two example text files and specify comparison type
as binary:

If you do not specify type, visdiff creates
the default comparison type for your selected files, in this case,
text comparison. By changing to the binary comparison type you could
examine differences such as end-of-line characters.

Similarly, when you compare XML files without specifying type,
you get a hierarchical XML comparison report. If instead you want
a text or binary comparison, you can specify "text" or "binary" comparison
types to see more details. When you compare zip files, the default
comparison type is a file list comparison, and you might want to specify
a binary comparison instead.

Alternatives

As an alternative to the visdiff function,
compare files and folders using any of these interactive methods:

From the Current Folder browser:

Select a file or folder. Right-click the file or folder,
and select Compare Against.

For two files or subfolders in the same folder, select
the files or folders. Then, right-click, and select Compare
Selected Files/Folders.

From the MATLAB desktop, on the Home tab,
in the File section, click Compare and
then select the files or folders to compare.

If you have a file open in the Editor, on the Editoror Live Editortab, in
the File section, click Compare.
Alternatively, under Compare, you can choose
a file to compare against, or compare with the autosave version or
the version on disk. See Comparing Files with Autosave Version or Version on Disk.