Why do I receive an error when trying to import a MAT file in MATLAB 7.0 (R14)?

2 views (last 30 days)
When I try to run the commands :
clear;
v6file='original';
v7file='new';
load(v6file);
save(v7file,'a','b','c','d');
load(v7file);
where original.mat is a MAT-file created in MATLAB 6.5 ( R13).
I get the error:
??? Error using ==> load
Unable to read MAT-file C:\MATLAB7\work\new.mat
File may be corrupt.
Even when I save the variables without Unicode, using the command:
save(v7file,'a','b','c','d','-nounicode');
load(v7file)
I receive the same error.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in MATLAB 7.0 (R14) in the way that it handles the loading of MAT files.
Currently to work around this issue, use the '-v6' option to save the MAT file in a MATLAB 6.5 (R13) compatible version:
v6file='original';
v7file='new';
load(v6file);
save(v7file,'a','b','c','d','-v6');
% The following line should be executed from MATLAB 6.5 (R13)
load(v7file)

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!