MATLAB freezes up upon screen lock

When MATLAB is open on my Mac OSX 10.14.3 computer and I lock the screen then after some time I unlock the screen by logging back in and then find that MATLAB has frozen up. I need to kill the MATLAB process in order to restart and use MATLAB again.

9 Comments

This seems to happen to me most repeatably when I'm connected to an external monitor, lock the screen and then close the laptop. On Mac OSX 10.14.5 and using Matlab R2019a.
People have reported similar issues with Mac associated with closing a laptop resulting in Suspend. I think I have seen similar issues reported on Windows laptops that are suspended.
I have the same issue. Matlab 2019b freezes when my MacBook Pro 2017 with Touchbar goes to sleep and Matlab is running on my 2nd LG Ultra HD display. It does not happen when Matlab is running on the MBP display and no other display is connected. Is Mathworks working on a solution? Hard to keep longer jobs running while working from home with this issue going on.
This happens to me every time when I connect to an external display, does anyone find a solution to fix it?
Same problem with Matlab2021b and macos 11.6 !!
Older version of matlab does not lead to this problem.
Feng Cheng
Feng Cheng on 27 Oct 2021
Edited: Feng Cheng on 27 Oct 2021
R2018/2019/2020 all have same problem on macos 10 with dual monitors!!
Same problem with a single external monitor, Matlab2021b on Mac Mini with M1 processor. Some solution?
I've been having this problem for several years. I've reached out to Mathworks and have gotten very little assistance. In the past it was sporadic, but recently, it is happening nightly, which is super aggravating. I'm running R2020b Update 3, on macOS Big Sur ver 11.6.3. MacBook Pro (16 inch, 2019) running two external monitors.
Same here. Given this issue is reported first at least 3 years ago, its unfortunate there is no solution yet.

Sign in to comment.

Answers (1)

Sean Kenny
Sean Kenny on 12 Apr 2022
I don't know if this will help anyone else, but here's what I did to eliminate this issue. My collegue came up with this as a solution to another Matlab glitch.
I have two monitors connected (laptop closed). One monitor is direct connected via USB-C from the laptop. The second monitor is connected via HDMI using a CalDigit docking station. By running some monitor power off tests, I determined that there was a pattern associated with the matlab "freeze" events.
Monitor 1: directly connected through USB-C
Monitor 2: HDMI connected through docking station
Tests:
  1. Turn off Monitor 2– No crash (regardless which monitor is showing plot window & command windows )
  2. Turn off Monitor 1 - CRASH (Monitor 2 is showing plot & command windows)
  3. Turn off Monitor 1 - No crash ( Monitor 1 is showing plot & command windows)
Seeing this data, my collegue suggested that I change the "Arragement" of the monitor in the Macbook's setting. What I did was to make the HDMI monitor have the “menu bar”. This should be the monitor that the password dialog shows up on when it comes out of sleep mode. The menu bar is the draggable white bar in Settings->Displays->Arrangement.
Hope this helps!!

2 Comments

Thanks Sean. Good diagnostics. However, rejiggering one's desktop every time you put your system to sleep may be nearly as cumbersome to some as having to kill/restart matlab because it froze. So it's a good workaround for some, but not the silver bullet for all. Hopefully your diagnostics give matlab developers some fodder that will help them solve this issue for real!
Yes, this is something Mathworks should have fixed years ago. Regarding the "fix" I posted, as long as you keep your monitors on the same ports, I don't believe that you'll need to make additional changes to the menu bar. At least this has worked for me, but my system remains mostly stationary, so my use case may not be typical.

Sign in to comment.

Categories

Products

Release

R2017a

Tags

Asked:

on 18 Mar 2019

Commented:

on 12 Apr 2022

Community Treasure Hunt

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

Start Hunting!