Save function is taking too long and Execution cannot be stopped
조회 수: 49 (최근 30일)
이전 댓글 표시
I'm trying to save some very large variables and testing out various ways of saving them that might best work for my workflow.
However often the save function ends up doing nothing and the command is not completed and cannot be broken with CTRL+C forcing me to force quit matlab with the task manager, which then means many hours of reloading the data back into the workspace (which is why I want to save these variables in the first place)
When you force quit matlab a window pops up and asks if I want to "stop now and exit". Is there any way to utilise this stop now aspect without actually exiting and losing the workspace?
댓글 수: 0
답변 (1개)
Amit Dhakite
2023년 6월 5일
Hi Nadav,
As per my understanding, you want to save very large variables in a file, but the operation is not completed and takes too long.
For your query regarding force quitting MATLAB, unfortunately there is no way to preserve the variables after the MATLAB closes, unless the process of saving them completes.
However, to improve the speed of saving large variables in a file, you may want to consider utilizing a 3rd party function called “savefast()”.
Please keep in mind that while this function has been developed and shared by a MATLAB user on the MathWorks File Exchange, it is not a built-in part of MATLAB and is not directly supported by MathWorks. You can learn more about "savefast()" and its applications through the link provided here: https://www.mathworks.com/matlabcentral/fileexchange/39721-save-mat-files-more-quickly
댓글 수: 1
Walter Roberson
2023년 6월 5일
Or you could
save(FileName, Variables..., '-v7', '-nocompression')
If you are saving large enough objects you would need -v7.3
Note that -v7.3 is generally significantly slower than -v7 if you have struct or cell array or any other composite datatype
참고 항목
카테고리
Help Center 및 File 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!