visdiff
Compare two files or folders
Description
visdiff(
opens the Comparison Tool and displays the differences between the two files or
folders. The Comparison Tool supports MATLAB® code files, zip files, MAT files, and various other MATLAB and Simulink® file formats. For a complete list, see Input Arguments.filename
1,filename
2)
Use visdiff
to compare two Simulink models, identify changes, and merge differences. For more information,
see Model Comparison (Simulink).
compares two files and returns a comparison object that contains the differences
between the specified files. Use the comparison object to manipulate the comparison
at the command line, for example by applying filters and publishing comparison
reports. This syntax does not open the Comparison Tool and does not require a
display. It is particularly useful for automating the creation of comparison reports
for continuous integration (CI) workflows. This syntax does not support all file
types. Supported files include Simulink models, plain text files, MATLAB scripts, MATLAB apps, and text-based
source code files.comparison
= visdiff(___)
Examples
Input Arguments
Output Arguments
Limitations
In MATLAB Online™, the Comparison Tool does not support all file types. Supported file types include text files, MATLAB code files, folders, zip files, and Simulink models.
Alternative Functionality
You can open the Comparison Tool interactively.
MATLAB Home tab — In the File section, click Compare. Then select the files or folders to compare.
Current Folder browser — To compare a file or folder, right-click the selected file or folder and select Compare Against. To compare two files or folders, right-click the selected files or folders and select Compare Selected Files/Folders.
MATLAB Editor or Live Editor tabs — To compare a file that is open in the Editor, in the File section, click Compare.
MATLAB Editor tab — To compare a file with the autosave version or the saved version on disk, in the File section, expand Compare and select Compare with Version on Disk or Save and Compare with Autosave. If you modified the file, the Editor saves the file before comparing. The Compare with Version on Disk and Save and Compare with Autosave options are available only if you disable autosaving of changes. To do so, go to the Home tab, and in the Environment section, click Preferences. Then, select Editor/Debugger and clear Save changes upon clicking away from a file.
Simulink Editor — To compare a model that is open in the Editor, on the Modeling tab, in the Evaluate & Manage section, click Compare To.
Version History
Introduced in R2008bSee Also
Topics
- Compare Files and Folders and Merge Files
- Model Comparison (Simulink)
- Attach Model Comparison Report to GitHub Pull Requests (Simulink)
- Compare and Merge Requirement Sets Using Comparison Tool (Requirements Toolbox)