Matlab freezes. I am using mac Apple M2 Max. OSX sonoma
78 views (last 30 days)
Show older comments
plot(1:10,1:10) does plot a line but when I try to close it directly on the screen matlab freezes. This also happens when there are more than one fgures on the window. Lets say, there are two figures, if I try to close figure 2 first than matlab freezes but if I close the figures in order like figure 1 first then figure 2, matlab seems works fine.
I am using mac Apple M2 Max. OSX sonoma
4 Comments
geofo
on 5 Dec 2023
According to my experience, the figure order is not relevant, but it is as follows: if the Matlab figure is partially covered by another figure (or covered by any other window, not necessarily a Matlab figure), then it is possible to close the figure placed in the background (which is partially covered) without problems. If you have two Matlab figures and try to close the figure in the foreground, (which is fully visible, not partially covered), then Matlab freezes.
Tim Lueth
on 10 Jul 2024
This bug exist also with Matlab 2024a and not only on ARM (AppleSilicon) but also on Intel Macs. It is extremely annoying, and occurs sporadically, one day there are no problems the next day every closing of the window leads to problems (killing matlab process and restart it). There is another discusson here on matlab central in which the following solution was offered to be added into the startup function.
set(groot, 'defaultFigureCloseRequestFcn', 'close(gcf)');
warning off MATLAB:Figure:RecursionOnClose;
Unfortunately, this does NOT always work. The faster the computer is, the bigger the problems become, independent on the JAVA version Oracle/Corretto8/Corretto11
For this reason i've inserted a small delay using an absolute time period
set(groot, 'defaultFigureCloseRequestFcn', 'pause(0.05); close(gcf)');
warning off MATLAB:Figure:RecursionOnClose;
The pause command ith a very small delay, helps often in combination with the graphics interface of Matlab on OSX. At least on my MACs (5) the pause solved the problem.
Accepted Answer
the cyclist
on 29 Oct 2023
This is a known bug with R2023b (and also older releases) on Sonoma, officially acknowledged by the MathWorks Support Team. See this question/answer for lots of folks discussing it.
Regarding Walter's question, you are probably not using the "New Desktop", because the specific figure-closing bug does not occur there.
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!