Large MAT file corrupted by multiple loading

4 views (last 30 days)
I have recently run into a recurring problem with previously sound MAT files becoming inexplicably corrupted. This has happened with multiple distinct MAT files and with no obvious pattern. The latest example is a file that is supposed to load two multiple-element structures with fields that contain only numeric arrays:
whos
glAll 1x412 21707848 struct
dissAll 1x412 5207459268 struct
I repeatedly loaded and worked with the data in the file for about 4 days. On the fifth day, running the same code (load myFile.mat) produces an "Unable to read file" error, without further explanation. The MAT file was not modified in my scripts, and nothing in the directory structure has changed (ie. the file is present in the working directory). In this example the MAT file is quite large (5 GB) but I've had the same problem with smaller files (~500 MB). This particular file was created using
save -v7.3 GliderDissAll.mat glAll dissAll
but I've had the same issue with -v7 files. I am running OS X El Capitan 10.11.2 and R2015b. Why do my previously-uncorrupted files suddenly become corrupted, though they were never explicitly modified?
Update: I should mention, the working directory is on an external server not on my local machine. I connect to the server through a local ethernet over the thunderbolt port.
  3 Comments
Arnold Ammann
Arnold Ammann on 28 Sep 2023
I am having a very similar issue, except it tells me "Unable to read MAT-file Not a binary MAT-file. Try load -ASCII to read as text." This file was created in another script and saved as a .mat file.
Walter Roberson
Walter Roberson on 28 Sep 2023
I suspect you can get that error message if you run out of memory while trying to load the file.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!