Hello,
I`m a 2016B user. This version complains about my synthetic data storage and says that
For variables larger than 2GB use MAT-file version 7.3 or later
I cannot obtain higher version. Any idea on how to store big data?
Thanks in advance

2 comentarios

Adam
Adam el 7 de Feb. de 2018
You would probably be better splitting your data into chunks if that is possible. Saving large files to v7.3 can be very bad in terms of performance.
Jan
Jan el 7 de Feb. de 2018
The message is clear already: All you have to do is to append the -v7.3 flag to your save command (see Kai's answer) or to set this as default in the preferences.

Iniciar sesión para comentar.

 Respuesta aceptada

Kai Domhardt
Kai Domhardt el 7 de Feb. de 2018

30 votos

Take from the reference and tested with Matlab R2016b:
save('myFile.mat', 'Variablename', '-v7.3')
will save your variable ( > 2GB ), provided you are running on an 64-bit system

13 comentarios

Jan
Jan el 7 de Feb. de 2018
Matlab 2016b runs on 64 bit systems only, so this is the valid solution already. +1
Erdem Altuntac
Erdem Altuntac el 7 de Feb. de 2018
I just gave it a try, but it seems to be endless procedure. It`s been more than 15 minutes already. It surely must depend on the size of my data.
Erdem Altuntac
Erdem Altuntac el 7 de Feb. de 2018
Thanks! It works.
Jan
Jan el 7 de Feb. de 2018
@Erdem: in the -v7.3 format the data are compressed, which takes time. See the '-nocompression' flag in the current Matlab version.
Adam
Adam el 7 de Feb. de 2018
Editada: Adam el 8 de Feb. de 2018
From my experience v7.3 takes a very long time to save and, for the data I saved, its 'compression' resulted in a file many orders of magnitude bigger than when using v7 (which I was able to use as my data was not 2 GB).
If you are expecting to use parts of the data rather than all of it in future then loading and saving the whole thing in one block every time will be woeful.
Erdem Altuntac
Erdem Altuntac el 7 de Feb. de 2018
Indeed, it took considerably long. But on the other hand, I really need to use whole data.
Ali Yar Khan
Ali Yar Khan el 5 de Feb. de 2020
then how i can load that data ?
Andrey Revyakin
Andrey Revyakin el 31 de Mzo. de 2020
I just tested this with reading and writing plain binary movies 512x512x4000 uint16 data, as opposed to reading and writing in matlab's v7 format as as single variable (save entire movie as an array of size (1, 512x512x4000). Writing took 5x longer than fwrite same array. Loading was 2x slower than fread, and at least twice as much RAM was needed.
jean vimal
jean vimal el 29 de Jul. de 2020
It works perfectly
Tan Nguyen
Tan Nguyen el 14 de Dic. de 2020
Thank you so much,
Ranjeet Singh
Ranjeet Singh el 10 de Oct. de 2023
Thank you so much
Imanol
Imanol el 10 de En. de 2024
Thank you so much
Julia
Julia el 29 de Oct. de 2024
I am having the same issue and am running MATLAB R2024a on a 64 bit PC. The .mat file I have is output from Dymola (not originally made in MATLAB) and contains five small variables and one large variable (2-3GB). It is not v7.3, but I can't see what version it is. The solution above seems like it saves the mat file to the 7.3 version if it has been successfully loaded into MATLAB, but I can't load my large variable into MATLAB in the first place, even with matfile() which only seems to accept v7.3. Thus when I try to save it, it erases the large variable completely. Do you have any insight into how to load the data into MATLAB considering this?

Iniciar sesión para comentar.

Más respuestas (2)

Steven Lord
Steven Lord el 7 de Feb. de 2018

0 votos

Open the documentation for the save function using doc save. In order to save your data to a MAT-file with version 7.3 or later, specify the '-v7.3' flag as the version input argument. The "Save Variables to Version 7.3 MAT-File" example on that page shows the exact syntax.
Stefanie Schwarz
Stefanie Schwarz el 9 de Sept. de 2025

0 votos

There is also a MATLAB preference that you can set:
  • In R2024b and earlier: Open Preferences > General > MAT-Files and then select "MATLAB Version 7.3 or later" as the default "MAT-file save format".
  • In R2025a and later: Open Settings > General > MAT and FIG Files and then select "MATLAB R2006b (Version 7.3) or later" as the default "MAT and FIG files save format".

Categorías

Preguntada:

el 7 de Feb. de 2018

Respondida:

el 9 de Sept. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by