Matlab quits after running live script for about 10 minutes.

1 visualizzazione (ultimi 30 giorni)
I've been having problems running one live script of mine for a few days now. The code is set to run through 280 .ncdf files; however, because of the size of the files, I've been running the blocks of code by changing k=1:280 to k =1:100 then k=101:280... etc. I have even tried cutting these segments into groups of 2 towards the end for the larger files.
Even though I'm cutting the amount of information matlab needs to handle, it still is not working. In the largest files, towards the end of the list (files 270-280), matlab will quit and shut down without any error message. The code runs perfectly fine and I don't get errors running it for the smaller files, so it doesn't have to do with the code.
I'm thinking it could have to do with the new update? I just updated my matlab to the newest software (MATLAB R2021a). This has never happened to me before on the other software. If anyone has any thoughts or recommendations PLEASE let me know!!!
  1 Commento
dpb
dpb il 15 Ago 2021
Only way think anybody here can do anything is to have your script and a failing data file...

Accedi per commentare.

Risposte (1)

Daksh
Daksh il 2 Feb 2023
I understand you're experiencing MATLAB crashing after running a complex file for considerable time. However, without seeing the code it is impossible to suggest a solution. There is no magic "do not crash"-flag, which means that you'll have to debug the code, and maybe 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 crashes again, kindly check the event log of the operating system also for a new entry.
If you have found out, where the code crashess, insert some code to stop the execution exactly before the crash, e.g.:
if k==17 && b==47196
keyboard; % -> Breakpoint here
end
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. Hope this helps!

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by