6.6 GB mat file load error with MATLAB 2014b: Error using load Cannot read file
Show older comments
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
Alka Nair
on 14 Aug 2015
Hi, Could you provide a snapshot of the error message?
Thanks, Alka
Junfei Tang
on 14 Aug 2015
Edited: Junfei Tang
on 14 Aug 2015
Answers (2)
Jan
on 14 Aug 2015
1 vote
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
Junfei Tang
on 14 Aug 2015
Edited: Junfei Tang
on 14 Aug 2015
Junfei Tang
on 14 Aug 2015
Edited: Junfei Tang
on 14 Aug 2015
Walter Roberson
on 14 Aug 2015
Edited: Walter Roberson
on 14 Aug 2015
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')
Alicia Cardona
on 8 Jun 2016
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?
Walter Roberson
on 8 Jun 2016
What does whos -file report for the file?
See also
Alicia Cardona
on 8 Jun 2016
Edited: Walter Roberson
on 8 Jun 2016
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!
Walter Roberson
on 8 Jun 2016
It appears that there is the potential for recovering some portions of the file.
Alicia Cardona
on 8 Jun 2016
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...
Walter Roberson
on 8 Jun 2016
If you have R2013b or later you should be able to use
supportPackageInstaller
to install the package.
Junfei Tang
on 5 Sep 2015
0 votes
Categories
Find more on Historical Contests in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

