No BSD License  

Highlights from
Compare two .mat files

4.3 | 6 ratings Rate this file 29 Downloads (last 30 days) File Size: 16.8 KB File ID: #5160

Compare two .mat files


Xianyao Chen


08 Jun 2004 (Updated )

Compare two .mat files and display the contents and difference of mat files.

| Watch this File

File Information

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;
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.


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

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
09 Jan 2012 Jochen Rau

Jochen Rau

Very useful. Thanks!
Another nice extension would be to integrate sth like submission #22752 (recursive comparison of structures) if a variable is a structure.

18 Oct 2011 Natalia


Excellent, thank you!

07 Dec 2010 Mohammed


good one

03 Mar 2008 HOng T


04 Jul 2007 Dadi Gudmundsson

Simple, effective, useful.

08 Mar 2007 Helps Alot

Thank you so much

Contact us