5

I have a 800x6 cell array vol, whose 1st to 5th columns are double and 6th column is a 200x200x200 3D double matrix. I am trying to save it to a variable, a .mat file more specifically.

>> save('./vol.mat', 'vol');
Warning: Variable 'vol' cannot be saved to a MAT-file whose version is older than 7.3.
To save this variable, use the -v7.3 switch.
Skipping... 

Why is it so? How should I fix it?

P.S.: I feel rather reluctant to save this cell array as a text file, as doing so sort of "destroys" the structure.

Amro
  • 123,847
  • 25
  • 243
  • 454
Sibbs Gambling
  • 19,274
  • 42
  • 103
  • 174
  • 1
    I found some interesting stuff that relates to this [here](http://www.mathworks.com/matlabcentral/answers/15521-matlab-function-save-and-v7-3). Apparantly, it is because of the size of the cell array (>2GB). – MeMyselfAndI Oct 18 '14 at 15:13
  • see this: [MATLAB: Differences between .mat versions](http://stackoverflow.com/q/4950630/97160) – Amro Oct 18 '14 at 15:35

1 Answers1

2

I guess this is attributed to the data type you are using. Just try what the error message suggests:

save('./vol.mat', 'vol', '-v7.3')

Version 7.3 of the .mat file format is actually newer than the default version ('-v6'). It has the drawback that it lacks backward compatibility with very old matlab versions, is said to be only available on 64bit systems and is said to be solw. Apart from that I see no reason not to use '-v7.3'.

BTW, I think you can strip the './' and .mat, as these are the defaults, so

save('vol', 'vol', '-v7.3')

should also work (it does so for me in a similar situation).

wsj
  • 677
  • 7
  • 11