How to properly save workspace?

조회 수: 5 (최근 30일)
MICHELE
MICHELE 2014년 8월 7일
댓글: Geoff Hayes 2014년 8월 7일
Hi,
after running my script I have all my variables in the workspace. I saved the workspace in a .mat file (using the save workspace option), unfortunately when I open it later on I always get the message " the file is corrupted". Could it happen because the file is too big? In case how to properly save large workspace?
thanks a lot.
  댓글 수: 3
MICHELE
MICHELE 2014년 8월 7일
I don't know how large is the file, but I assumed it is quite big because there are several matrices (1000x35040). It would be important for me to save it entirely, because it takes a while for running the simulation, therefore it would be easier.
Geoff Hayes
Geoff Hayes 2014년 8월 7일
Try saving the data with the '-v7.3' flag. For example,
A = rand(5);
B = magic(10);
save('example.mat','A','B','-v7.3')
According to save, this flag/switch has Version 7.0 features, plus support for data items greater than or equal to 2 GB on 64-bit systems.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by