Why is Simulink displaying correctly only as root user?

1 次查看(过去 30 天)
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.

回答(1 个)

Shubham
Shubham 2024-2-18
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 个评论
Antoine Dupont
Antoine Dupont 2024-2-20
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!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by