필터 지우기
필터 지우기

Matlab freezes. I am using mac Apple M2 Max. OSX sonoma

조회 수: 91 (최근 30일)
Amdad
Amdad 2023년 10월 27일
댓글: Tim Lueth 2024년 7월 10일 7:34
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
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
Tim Lueth 2024년 7월 10일 7:34
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
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개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by