How to save struct datatype to disk

조회 수: 7 (최근 30일)
ginessgold Malik
ginessgold Malik 2012년 1월 6일
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.

채택된 답변

Jonathan Sullivan
Jonathan Sullivan 2012년 1월 6일
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
ginessgold Malik
ginessgold Malik 2012년 1월 6일
Thanks it worked with the '-v7.3'

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Andrew Newell
Andrew Newell 2012년 1월 6일
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';

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by