6.6 GB mat file load error with MATLAB 2014b: Error using load Cannot read file

Hi,
I saved a 6.6 GB mat file with MATLAB 2014b previously and now I need to open it with the same computer and the same version of MATLAB.
I clicked the "open" button under the "HOME" tab in the MATLAB window and found the mat file and "open". However, MATLAB gave me this:
Error using load Cannot read file D:\MATLAB & Simulink Simulation Results\XXX\XXX.mat.
I tried to change the path but it could not work.
Do you know how can I load the large mat file to the workspace?
Thank you in advance!

2 Comments

Hi, Could you provide a snapshot of the error message?
Thanks, Alka
Thank you for your reply. Here it is:

Sign in to comment.

Answers (2)

There can be many different problems: Perhaps you do not have enough free RAM? Or the file is damaged? So please post the complete error message. Did you try to use the load command?

9 Comments

Thank you for your reply. I tried to use load command but:
Previous I load a small file like 200 MB, the "load" command works fine. In addition, the 6.6 GB file is saved in '-v7' instead of '-v7.3'.
The problem should not come from RAM since I have 16 GB in the computer and once the RAM is not enough, the computer just shuts itself down, but this time it did not.
Maybe MATLAB cannot detect '-v7' and '-v7.3' automatically, which means I must inform MATLAB of the mat file version, otherwise MATLAB will load the '-v7' mat file through the '-v7.3' way and cannot understand the file? But how to inform MATLAB of this?
MATLAB automatically detects -v7 and -v7.3 files and handles them as required.
Try
[fid, message] = fopen('D:\MATLAB & Simulink Simulation Results\XXX\XXX.mat');
if fid < 0
fprintf('file could not be opened because: |%s|\n', message);
else
firstline = fgetl(fid);
fclose(fid);
fprintf('first line of file is: |%s|\n', firstline);
end
This will give a hint as to whether the file is missing or unopenable or not a .mat file at all.
Also, try
whos('-file', 'D:\MATLAB & Simulink Simulation Results\XXX\XXX.mat')
Hi! I have the same problem, just saved my workspace yesterday and the .mat file is only 3.67GB, but still gives me the same error message that it cannot read the file. Walter Roberson I tried your code and it gave me this: first line of file is: MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Tue Jun 07 21:11:40 2016 IM & xœãc``0 b6 æ€Ò À
what can I do now?
Name Size Bytes Class Attributes
%
% Fs 1x1 8 double
% PSP 21120001x1 168960008 double
% PSP2 21120001x1 168960008 double
% PSP2_01_duration 1x1 8 double
% PSP2_01_end 1x1 8 double
% PSP2_01_start 1x1 8 double
% PSP2_90 14252661x1 114021288 double
% PSP2_90_peak 3x1 24 double
% PSP_01_duration 1x1 8 double
% PSP_01_end 1x1 8 double
% PSP_01_start 1x1 8 double
% RMS_dB 1x1 8 double
% SL1 2048x1 16384 double
% a 1x9 72 double
% a1 1x9 72 double
% ans 1x1 8 double
% b 1x9 72 double
% b1 1x9 72 double
% e 21120001x1 168960008 double
% e_1 21120001x1 168960008 double
% em 21120001x1 168960008 double
% em_1 21120001x1 168960008 double
% f 1x2048 16384 double
% file 1x83 166 char
% g 2x2 32 double
% g1 2x1 16 double
% g1_1 2x1 16 double
% g2 2x1 16 double
% g2_1 2x1 16 double
% g3 2x2 32 double
% g_1 2x2 32 double
% k5 1x1 8 double
% k5_1 1x1 8 double
% k95 1x1 8 double
% k95_1 1x1 8 double
% path 1x63 126 char
% peak 1x1 8 double
% peak_dB 1x1 8 double
% rms 1x1 8 double
% rms_dB 1x1 8 double
% rms_peak 1x1 8 double
% rms_peak_dB 1x1 8 double
% wave 63985786x2 1023772576 double
% wave_f 63985786x2 1023772576 double
% wave_f2 63985786x2 1023772576 double
% wave_f2_2 63985786x1 511886288 double
% wave_f_2 63985786x1 511886288 double
thanks I'll check them now!
It appears that there is the potential for recovering some portions of the file.
Oh really? how could I do so? thank you! I have some weird problem with the mathworks file exhange website as it doesn't download the folders from the links you send me...
If you have R2013b or later you should be able to use
supportPackageInstaller
to install the package.

Sign in to comment.

Thank you very much everyone!
Sorry that I did not reply to you until now.
I discarded my old mat file since I was informed that the setup for the simulation should be modified afterwards. Then I rerun the simulation and saved the workspace data as a mat file in version "-v7.3":
Home / Preferences / General / MAT-Files: MATLAB version 7.3 or later (save -7.3)
Later on, when I needed to use the data, the new mat file in "-v7.3" was loaded without problem.
This is what I have experienced and anyone who encounters the same problem may refer to this.
Thank you for your attention again!
Sincerely,
Junfei Tang

Categories

Find more on Historical Contests in Help Center and File Exchange

Tags

Asked:

on 12 Aug 2015

Commented:

on 8 Jun 2016

Community Treasure Hunt

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

Start Hunting!