The official documentation states the following:
. But I have noticed that there are other important differences besides those stated in the table above.
For example, saving a cell array with about 6,000 elements that occupies 176 MB of memory in MATLAB gives me the following results depending on whether I use -v7 or -v7.3:
Has anybody else noticed these differences?
Update 1: As the replies point out, -v7.3 relies on HDF5 and according to Mathworks, "this format has a significant storage overhead", although it's not clear if this overhead is really due to the format itself, or to the MATLAB implementation and handling of HDF5 instead.
Update 2: @Andrew Janke points us to this very helpful PDF (which apparently is not available in HTML format on the web). For more details, see the comments in the answer provided by @Amro.
This all takes me to the next question: Are there any alternatives that combine the best of both worlds (e.g. the efficiency of -v7 and the ability to deal with very large files of -v7.3)?
MATLAB® desktop — Go to the Home tab and, in the File section, click Compare. Click the. button to select items to compare, or drag and drop files from your file browser into the First file or folder or Second file or folder fields. Current Folder browser — Select a file, right-click, and select Compare Against.
MAT-files are binary MATLAB® files that store workspace variables. Starting with MAT-file Version 4, there are several subsequent versions of MAT-files that support an increasing set of features. MATLAB releases R2006b and later all support all MAT-file versions.
Files with a . m extension contain MATLAB code, either in the form of a script or a function. Files with a . mat extension contain MATLAB formatted data, and data can be loaded from or written to these files using the functions load and save , respectively.
What is the basic difference between M-files and MAT-files? Explanation: M-files are ASCII text files which are used to simplify our program editing in MATLAB, they are basic text files. MAT files are Binary files created by MATLAB. When we need to save any data from the workspace, it is saved in MATLAB as a MAT file.
Version 7.3 of MAT-files uses HDF5 format, this format has a significant storage overhead to describe the contents of the file, especially so for complex nested cellarrays and structures. Its main advantage over previous versions of MAT-files is that it allows storing data larger than 2GB on 64-bit systems.
Note that both v7 and v7.3 are compressed and use Unicode encoding (unlike v6), yet they are two completely different formats...
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With