Matlab R2020b freezes when closing figure (Intel macOS Big Sur)
300 ビュー (過去 30 日間)
Matlab R2020b Update 3 always freezes when closing a figure window containing any axes by using the top left closing button.
The operating system I am using is macOS Big Sur 11.1 on an Intel Mac Book Pro from mid-2017. No startup scripts are run.
On my system this can always be reproduced by opening Matlab 2020b and run the following command from the command window
The figure opens as expected but using the red close button on the top left corner to close the window, Matlab instantly freezes and a spinning ball animation is shown. Matlab must be force quit then.
There is no problem closing the figure using the command
This bug makes working with Matlab completely impossible to me. A similar behaviour could be seen on my system with previous Matlab versions like R2020a on macOS Mojave. But back then the bug was not so easy to reproduce. From time to time when closing a window belonging to Matlab it also froze.
回答 (21 件)
Lakshmanan Swaminathan 2021 年 5 月 17 日
I do have the same problem with Matlab_R2020b running on M1 Macbook Pro with macOS Big Sur 11.3.1. Not just closing figures, it freezes in many occasions. And the only way is to force quit and reopen again leading to lose the progress of work.
Kazuhiro Maeda 2022 年 1 月 29 日
I wrote a simple script. I hope it helps. I'm not sure this works for M1.
% When you try to close figure windows, MATLAB for Mac sometimes gives you
% the rainbow cursor of death and hangs up. A walkaround is to turn off
% apps that use Mac's Accessibility API. Go to System Preferences >
% Security & Privacy > Privacy > Accessibility and unmark some apps there.
% This script is helpful to identify the apps that cause the problem.
% (1) Run this script. If it finishes without any problems, you don't have
% the "can't close a figure" issue. Lucky you! If your MATLAB hangs up
% or becomes sluggish, go to (2).
% (2) Turn off an app shown in Accessibility and go to (3).
% (3) Run this script again. If you finished it without any problems, then
% it is likely that the app you just turned off interferes with MATLAB.
% So, it should be turned off while you use MATLAB (and ask MathWorks
% to fix this long-standing issue). If you got some problems while
% running this script, go back to (2) and turn off another app.
for i = 1 : 10
for j = 1 : 10
fprintf('--- All figures closed\n')
In my case, RescueTime was the one that prevented MATLAB from closing a figure window.
From this link, I followed the instructions for giving Matlab full disk access. Seems to have solved the problem.
Chenyang Zhang 2022 年 3 月 24 日
Go to Mac - System Preferences - Privacy - Accessibility
Try disabling some App here, and find which one cause the conflict to MATLAB. Then this problem can be avoided. As for my case, I disable the Grammarly and then all things go well.
Hope MATLAB can solve this problem.
Abdul Hannan Raja 2021 年 4 月 23 日
I am having this same problem on M1 Macbook Air with apple silicon chip. I have no idea what is causing this issue. I guess i am not alone anymore.
Tahmid Hassan Talukdar 2021 年 5 月 27 日
Havint this same problem. Hope MathWorks fixes this soon. I'm unable to do any work due to this.
Dmitry Kabanov 2021 年 7 月 15 日
I have the same problem on macos Big Sur 11.4 with Matlab R2021a 18.104.22.1682886 on Intel iMac Pro 2017.
Matlab is unusable as it hangs when I close a figure.
I am having this problem too on an Intel Mac Pro 2013 with Matlab R2021a.
Kazuhiro Maeda 2022 年 1 月 28 日
Big Sur 11.6.1
Mac Pro (2019)
After "close all" or clicking the left-top red "x" button of a figure window, a rainbow cursor of death appears and MATLAB hangs up. This happens not always but occasionally. So, it's difficult to find why this happens.
I just read this post and turned off Accessibility Permissions for some apps. I hope this will work. This "Accecibility problem" has been around for years (like this), and I don't understand why MathWorks devs don't fix it.
I think MathWorks should implement a better bug report program (or even telemetery program). If MATLAB hangs up, the bug report dialog doesn't appear. So, they never notice this issue.
Preetham Manjunatha 2022 年 3 月 19 日
MATLAB R2022a still freezes when the Figure window is closed on macOS 12.3.
Carl Werner 2022 年 3 月 31 日
Yes - Grammarly and my window manager app, Rectangle make Matlab lose its mind. The window manager Magnet, also does not coexist well with Matlab.
Qi Wang 2022 年 5 月 6 日
Same issue for me. Problem solved after I disable the "voice control" in the System Preferences. Hope this helps
Pistachio 2022 年 7 月 21 日
編集済み: Walter Roberson 2022 年 11 月 17 日
Same problem for me.
In my case, MATLAB often freezes when closing a number of heavy figures.
The cause of this problem is most probably that MATLAB goes on the next closing process before completing current closing process that takes some time due to the large data set included in the figures. In this case, close each figure by “for” followed by a command such as “disp” and “waitbar”. But “1+1” doesn't work. Though “pause(n)” does work, I don't recommend this, because optimum time is not known. I prefer “waitbar” to “disp” because I don't like a mess in command window, but “waitbar” can be replaced by “disp” or something. Accordingly, I solved this issue by following function.
h = findobj('Type','Figure');
I0 = numel(h);
msg = ['Closing ' num2str(I0) ' figures.'];
f = waitbar(0,msg);
for i0 = 1:I0
waitbar(i0/I0,f, ['Closing ' num2str(I0) ' figures... (' num2str(i0) '/' num2str(I0) ')'])