Warning: Initializing MATLAB Graphics failed.

66 views (last 30 days)
Steradiant on 12 Oct 2020
Answered: Jim Svensson on 25 Feb 2021
I installed MATLAB 2020b on Ubuntu 20.04 LTS. Everytime when I start matlab I get the following warning:
Warning: Initializing MATLAB Graphics failed.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
Index exceeds the number of array elements (0).
> In hgrc (line 165)
In matlab.graphics.internal.initialize (line 15)
Does anyone have an idea how to fix that?
tkazik on 19 Jan 2021
Unfortunately, this is still not solved with the third update of 2020b. The suggestions by @Hannes Gorges with the corrections by @Bruno Luong seem to work and this issue seems to be related to a setup with multiple monitors (apparently some negative indices by the display layout are creating trouble). So I guess the current suggestion does the job, but is still not 100% correct, given that:
% this returns only the 'layout' of the first monitor (size: 1x4)
screen = get(groot, 'ScreenSize');
% returns the full 'layout' of dual monitor (size: 2x4)
screenPos = get(groot, 'MonitorPositions');
So the proper fix will likely have to use the second cmd.

Sign in to comment.

Answers (1)

Jim Svensson
Jim Svensson on 25 Feb 2021
I have this problem. When can we expect an official fix?


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!