No BSD License  

Highlights from
Compare two .mat files

4.33333

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

Compare two .mat files

by Xianyao Chen

 

08 Jun 2004 (Updated 10 Jun 2004)

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

| Watch this File

File Information
Description

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

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
08 Mar 2007 Helps Alot

Thank you so much

04 Jul 2007 Dadi Gudmundsson

Simple, effective, useful.

03 Mar 2008 HOng T

concise.

07 Dec 2010 Mohammed

good one

18 Oct 2011 Natalia

Excellent, thank you!

09 Jan 2012 Jochen Deibele

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

Please login to add a comment or rating.
Updates
10 Jun 2004

Including source code.

Tag Activity for this File
Tag Applied By Date/Time
path Xianyao Chen 22 Oct 2008 07:22:56
directories Xianyao Chen 22 Oct 2008 07:22:56
files Xianyao Chen 22 Oct 2008 07:22:56
compare Xianyao Chen 22 Oct 2008 07:22:56
mat Xianyao Chen 22 Oct 2008 07:22:56
utilities Xianyao Chen 22 Oct 2008 07:22:56
mat file Xianyao Chen 22 Oct 2008 07:22:56
file Xianyao Chen 22 Oct 2008 07:22:56
compare Daneil Briker 19 Aug 2011 02:59:55
mat file Satheesh 10 Feb 2012 12:21:29

Contact us at files@mathworks.com