MATLAB Answers


Unable to load, File may be corrupt

Asked by lina
on 27 Feb 2013


I have met with this(Unable to load, File may be corrupt) problem for several times lately. I also found a seems possible solution, which is at

However this solution does not always work, this time when I run splitmat, I got the message : 'Found bad 0-byte size at variable #1'. I don't understand this, and I really want to know a better solution to this, the reason for problem, or any suggestion of easy and more trustworthy way of saving data in matlab instead of .mat?

Thanks very much. Lina


  • Matlab release?
  • OS?
  • Version of mat-file?
  • How are the corrupt mat-files created?

I think mat-files are a "trustworthy way of saving data".

on 28 Feb 2013

Thanks for your reply, I'm using matlab R2011b ( on a 64 bit linux cluster. In terms of the mat file version, since I did not specify when I saved it, so I think it should be version 7, by creating, I just use save(filename, variablename). I have been able to successfully load it several days ago, but since yesterday, it was told to be corrupted.

What could be the potential reasons for mat file to be corrupted?


on 13 Jun 2013

Hi, I am having exactly the same issue, only difference is I am using Windows server 2008 (no cluster).

There is no obvious reason for the mat files to be corrupted (no concurrent writing, no HD failure).


No products are associated with this question.

1 Answer

Answer by Jason Ross
on 28 Feb 2013

You mention that you are using a cluster. Is it possible that multiple processes are trying to write to the same file simultaneously? This will inevetabaly lead to corruption.

An example situation would be if you are saving a file to a shared location with the same filename, so N MATLAB processes are trying to save (for example) /home/lina/myoutputs.mat .


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!