btaguy.blogg.se

Matlab 2019a keeps freezing
Matlab 2019a keeps freezing










) ĭrawnow pause ( 0.05 ) % this innocent line prevents the Matlab hang switch answer. While debugging EDT synchronization problems is notoriously difficult, the solution is often extremely simple - Just add a combination of drawnow and a short pause:ĭrawnow pause ( 0.05 ) % this innocent line prevents the Matlab hanganswer = questdlg (. Matlab-EDT synchronization problems are often time-dependent, which explains why the hang sometimes occurs and sometimes not. It is my belief that this creates race-conditions which in some cases cause a deadlock between Matlab’s Main Thread and Java’s Event Dispatch Thread (EDT). The underlying reason for the hang appears to be that when we close the modal dialog window, it is sometimes not yet fully destroyed when we proceed with our program. Moreover, when we debug the code, stepping through the source-code lines one at a time, everything seems to behave perfectly normal it is only when running the program in continuous mode that the hang appears. Secondly, the hang does not appear consistently – sometimes it does, other times not, making debugging extremely difficult. There are several odd things here: Firstly, the task manager shows that the Matlab process is not consuming any CPU. The only workaround is to open the operating system’s task manager and kill the Matlab process. After clicking the button, Matlab seems to freeze, and any attempt to close the window or to stop the GUI fails. The symptom is easily detectable: you’re happily working on your favorite Matlab GUI application, when suddenly some modal dialog window appears – perhaps a msgbox, a questdlg or an inputdlg. So I am taking this opportunity to explain the problem and the workaround, before my senility takes over and I forget again… 🙂

matlab 2019a keeps freezing

The last time this happened was only two days ago, and by pure coincidence a reader’s comment yesterday happened on the same page where I explained the problem and solution. The undocumented solution is frustratingly simple (see below), and yet I keep forgetting it. Closing a modal dialog may hang Matlab Every now and then I stumble on a case where Matlab hangs, becomes totally unresponsive and requires me to kill the Matlab process externally (via the task manager).












Matlab 2019a keeps freezing