Pass out of memory
이전 댓글 표시
I want to calculate the solutions of some huge linear system of equations by backslash function and save the norm of solutions in a excel file, and I don't want Matlab stopped when for some cases it has "Out of Memory". Please let me know how can I solve this problem
답변 (1개)
Walter Roberson
2023년 1월 13일
0 개 추천
You could add more ram.
In some cases you might be able to use sparse matrices.
In some cases you might be able to use tall() arrays.
댓글 수: 4
Ali Shahmoradi
2023년 1월 13일
이동: Steven Lord
2023년 1월 13일
Christine Tobler
2023년 1월 13일
이동: Steven Lord
2023년 1월 13일
You can wrap the call to backslash in a try/catch statement, and then in the "catch" say what you want to do if an error was thrown.
For example:
for ii=1:10
try
x{ii} = A{ii} \ b{ii};
catch ME
x{ii} = "Error occured";
end
end
If there is an out-of-memory error, x{ii} is just filled with that string instead of the solution of linear system, but the computation will continue.
Walter Roberson
2023년 1월 13일
Huh, I did not think it was possible to catch out-of-memory, but testing I see that it is in at least some cases.
Ali Shahmoradi
2023년 1월 14일
카테고리
도움말 센터 및 File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!