4
votes

I was trying to save a matrix into a mat file, but the Matlab returns the following messages:

Warning: Variable 'listmatrix' cannot be saved to a MAT-file whose version is older than 7.3. To save this variable, use the -v7.3 switch. Skipping...

What does it mean for "use the -v7.3 switch"?

Should I use

save testresult.mat -v7.3 listmatrix

or sth else?

2
Did you try it? Yes, your interpretation is correct. Not sure why you cannot use the new MAT file format. - nimrodm

2 Answers

2
votes

A quick google search says yes. Try

save -v7.3 testresult.mat listmatrix

How big is your object? (Do whos listmatrix) You could potentially save memory by using different data type such as uint8.

4
votes

Hi i thought I’d reply to this thread as I’ve been trying to figure out how to save a large (>2 GB) .mat file in matlab v7 (v7.1.0.183) (R14) and finally found a solution.

If you try to use the save command you will get the following error:

save('test.mat', 'data');

Warning: Variable 'data' cannot be saved to a MAT-file because its storage requirements exceed 2^31 bytes. This limitation will be addressed in a future release. Consider storing this variable in HDF5 file format (see HDF5WRITE). Skipping...

The solution is to write a HDF5 file instead:

hdf5write('test.hdf5', '/dataset1', data);

You can then read the data back into matlab using:

hdf5read('test.hdf5', '/dataset1');