How to save struct datatype to disk
조회 수: 7 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
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개)
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';
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!