No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Compare two .mat files

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.42857
4.4 | 7 ratings Rate this file 3 Downloads (last 30 days) File Size: 16.8 KB File ID: #5160 Version: 1.0

Compare two .mat files

by

Xianyao Chen (view profile)

 

08 Jun 2004 (Updated )

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   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
24 Feb 2016 Samuel Maliva

Very helpful

Please can I get the test function to compare aa.mat and bb.mat

Comment only
17 Jul 2015 Wenjie

Wenjie (view profile)

Very useful !
It's easy to use and helps a lot.

09 Jan 2012 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

concise.

04 Jul 2007 Dadi Gudmundsson

Simple, effective, useful.

08 Mar 2007 Helps Alot

Thank you so much

Contact us