Why is Simulink displaying correctly only as root user?

I have installed Matlab R2023b on Kubuntu 22.04.
When I try to use simulink after having started Matlab, it opens with a dark layout and with a very low resolution. But when I do it as root user, I can use Simulink with high resolution, and it displays well. Do you have an idea of what is happening?
I should also include that Matlab itself is displaying well in both cases.

Answers (1)

Hi Antoine,
It seems that Simulink is displaying dark layout with incorrect resolution. However, the same problem does not arise in Simulink when launched as a root user.
The reason for such an unexpected behaviour would be due to some user preferences that needs to be changed. The simplest way to resolve this issue is to launch Simulink as a root user. If sudo privileges are denied for some users, you can try referring to the following MATLAB Answer that describes how MATLAB supports high DPI screens on Linux:
You can also create a script for setting the display scaling as follows:
>> s = settings;s.matlab.desktop.DisplayScaleFactor;
>> s.matlab.desktop.DisplayScaleFactor.PersonalValue = 1;
>> quit;
Then you can use the MATLAB startup option '-r' to run this script by typing the following in the terminal:
matlab -r "<scriptname>"
This will set the display scaling and quit MATLAB. After MATLAB has quit, you can then restart again from the terminal: 
matlab
The following documentation page provides more details on the startup option ‘-r’: https://www.mathworks.com/help/matlab/ref/matlablinux.html#buknt9_-3
You may also have a look at the following MATLAB Answer detailing the scaling issue in Windows:
I hope this helps!

1 Comment

Hello Shubham,
Thank you for your answer. Unfortunately, using the matlab scaling parameter is not an option for me, as it changes the scaling of MATLAB itself, which I don't want as it is already set well.
I could open matlab each time as root, but it feels like it is not normal having to do that. So I would rather wait for an other solution.
Have a great day!

Sign in to comment.

Categories

Products

Release

R2023b

Asked:

on 6 Feb 2024

Edited:

on 20 Feb 2024

Community Treasure Hunt

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

Start Hunting!