MATLAB suddenly closes when running a complex script

조회 수: 3 (최근 30일)
Joel Schelander
Joel Schelander 2021년 4월 9일
답변: Jan 2021년 4월 9일
I made a large script in MATLAB 2019b on my computer. When I try to run it at my institutes computer (2017b) it crashes after a couple of minutes
How can I over come this?
  댓글 수: 3
Jan
Jan 2021년 4월 9일
Please explain, what "crashs" means: Do you get an error message? If so, which one? Is the memory exhausted before?
Joel Schelander
Joel Schelander 2021년 4월 9일
MATLAB make the sound that theres an error and immediately closes. So I cannot see the error message

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

답변 (1개)

Jan
Jan 2021년 4월 9일
Without seeing the code it is impossible to suggest a solution. There is no magic "do not crash"-flag, which can be enabled by professionals only.
You have to debug the code. Set some breakpoints to step through the code line by line. If this is too lengthy, try to enable the diary and display all performed commands:
echo(fullfile(tempdir, 'myEcho.txt'));
diary(fullfile(tempdir, 'myDiary.txt'));
% now run the code again
After Matlab has crashed again, check the event log of the operating system also for a new entry.
If you have found out, where the code crashs, insert some code to stop the execution exactly before the crash, e.g.:
if k==17 && b==47196
keyboard; % -> Breakpoint here
end
Then save the variables provided as input for the next step in a MAT file, such that you can examine the reason without the need for the former processing. The next command together with the input data are a useful start point to explain the details here in the forum.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by