How to save struct datatype to disk

6 vues (au cours des 30 derniers jours)
ginessgold Malik
ginessgold Malik le 6 Jan 2012
Hi,
I have searched around but have not gotten any useful answers. I have a structure, with each element containing a 1x1 cell and another structure. The second structure contains multiple structures each holding doubles of various lengths.
The entire structure takes up about 25 GB of RAM and I would like to save all the contents to disk. I have tried:
save('name.mat' ,'-struct', structname) without luck.
Do I have to do a sort of nested loop to save all contents to disk?
Thanks for the help.

Réponse acceptée

Jonathan Sullivan
Jonathan Sullivan le 6 Jan 2012
One other thing to note is that unless you are trying to save it using the most recent .mat file type (v7.3), you are limited to 2 GB. You can only save .mat files larger than 2 GB if you have a 64-bit system and have MATLAB version 7.3 (R2006b) or later. To do so, specify the correct version flag.
Example:
save('name.mat','mystructname','v7.3')
Hope this helps
  1 commentaire
ginessgold Malik
ginessgold Malik le 6 Jan 2012
Thanks it worked with the '-v7.3'

Connectez-vous pour commenter.

Plus de réponses (1)

Andrew Newell
Andrew Newell le 6 Jan 2012
What exactly is the problem you are having? If you just want to save the whole structure,
save('name.mat',structname)
will do it. Note that structname should be a string containing the name of your structure, e.g.,
structname='mystructname';

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by