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, requirement and link set files, 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 editors — Open a file in the MATLAB Editor or in the Live Editor. In the Editor or Live Editor toolstrip, select Compare > Compare To. Then, select the file you want to compare to.
You can also compare a file with the autosave version or the saved version on disk. In the Editor tab, select Compare > Compare to Version on Disk or Compare to Backup. If your file is modified, the Editor saves the file before comparing. The Compare to Version on Disk and Compare to Backup options are only available if the option for automatically saving changes to a file is disabled. To disable the option, go to the Home tab, and in the Environment section, click Settings. Then, select Editor/Debugger and clear Save changes upon clicking away from a file. This option is not available in the Live Editor.
Simulink Editor — To compare a model that is open in the Simulink Editor to another model on disk, on the Modeling tab, in the Evaluate & Manage section, click Compare To.
Files or Project panel — To compare two files on disk, select both files. Then, right-click and select Compare Selected Files/Folders. The Comparison Tool opens the file you select first on the left.
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)