MATLAB Answers

Using save with -v7.3 takes a long time and the mat file size is enormous

19 views (last 30 days)
Omar Abdelkader
Omar Abdelkader on 10 Nov 2016
Commented: Mike on 27 Feb 2020
I tried to save with -v7 the file size was 18 MB while with using -v7.3 it's 6 GB !!!

  4 Comments

Show 1 older comment
Adam
Adam on 10 Nov 2016
Yes, but save what in the mat file? The size of the mat file is directly proportional to the size of whatever variables you are saving in it, plus some overhead for the structure. That overhead should not be almost 6 GB though.
Walter Roberson
Walter Roberson on 10 Nov 2016
Can you make the 18 megabyte version available through something like Google Drive?

Sign in to comment.

Accepted Answer

George
George on 10 Nov 2016
I've run into this before too. From the matfile page there's a note
"Note: Version 7.3 MAT-files use an HDF5 based format that requires some overhead storage to describe the contents of the file. For cell arrays, structure arrays, or other containers that can store heterogeneous data types, Version 7.3 MAT-files are sometimes larger than Version 7 MAT-files."
Using the -v7 option was my remedy as well.

  3 Comments

Adam
Adam on 10 Nov 2016
I doubt that by larger they mean 6 GB vs 18 MB though. I don't know what the original poster is trying to save, but that is far too excessive a memory difference.
Omar Abdelkader
Omar Abdelkader on 10 Nov 2016
@George yea the -v7 works fine but only with small files @Adam that's why I'm asking the question because the difference it too huge I don't understand how or why although when i try to run it with a 32 bit matlab it gives me out of Memory error
Mike
Mike on 27 Feb 2020
I have a scenario where saving with v7.3 results in a 750 MB mat file whereas saving with v7 results in a 3.4 MB mat file. The data i was saving was an array of Simulink.SimulationOutput returned from a parsim command.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags


Translated by