Compare two .mat files
No License
Compare two mat files,
useage: matc matfile1.mat matfile2.mat
it will show three different releationship between the variables stored in mat file:
not exist, not equal, equal.
Although one can use
A = load matfile1;
B = load matfile2;
isequal(A,B)
to determine if two mat files are exactly same, it can not help one determine which variable in matfile1 is different or does not exist in matfile2.
Example:
matc aa.mat bb.mat
Source File: aa.mat --- Target File: bb.mat
--------------------------------------------------
Variable :: a || not exist
Variable :: b || equal
Variable :: c || not equal
--------------------------------------------------
Source File: bb.mat --- Target File: aa.mat
--------------------------------------------------
Variable :: ab || not exist
Variable :: b || equal
Variable :: c || not equal
--------------------------------------------------
Cite As
Xianyao Chen (2026). Compare two .mat files (https://www.mathworks.com/matlabcentral/fileexchange/5160-compare-two-mat-files), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | Including source code. |
