Matlab freezes. I am using mac Apple M2 Max. OSX sonoma
84 次查看(过去 30 天)
显示 更早的评论
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 个评论
geofo
2023-12-5
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
2024-7-10
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.
采纳的回答
the cyclist
2023-10-29
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!