Modified settings (PersonalValue) not persistent across sessions (display scaling)

11 次查看(过去 30 天)
I want to display Matlab on a high resolution 4K screen. I am using Matlab 2019b and my operating system is Linux Mint 18.3. With the default settings, the fonts and the icons are tiny, as described in question https://ch.mathworks.com/matlabcentral/answers/406956-does-matlab-support-high-dpi-screens-on-linux. I have changed the system settings of my OS (fonts and display scaling), which a lot of other programs obey, but Matlab does not.
I have tried to solve the issue using the answer
i.e.,
>> s = settings;s.matlab.desktop.DisplayScaleFactor
>> s.matlab.desktop.DisplayScaleFactor.PersonalValue = 1.5
However, the change to
s.matlab.desktop.DisplayScaleFactor.PersonalValue
does not persist across sessions: After restarting Matlab, PersonalValue 's value is undefined again.
I read in https://ch.mathworks.com/help/matlab/matlab_external/access-and-modify-settings.html that changes to PersonalValue are saved to the preferences folder, which in my case (according to prefdir) is ~/.matlab/R2019b. I have read and write access to this folder.
How can I change the DisplayScaleFactor permanently? Why are the settings not saved?
(Similarly, changing the Matlab font sizes in Preferences -> Fonts is not persistent for the Desktop code font; however for the Desktop text font, it is.)

采纳的回答

n_luethen
n_luethen 2020-3-18
Thank you @Harsha Priya Daggubati!
Renaming my preference directory to R2019b_old, as suggested in the link that you provided, and letting Matlab create a fresh one solved the problem! Now my preferences are saved across sessions and the display scaling works.

更多回答(2 个)

Harsha Priya Daggubati
Hi,
One possible workaround for your problem would be to use 'startup.m' and run the commands to change the DisplayScaleFactor. To identify the startup folder, type pwd at the command line immediately after starting MATLAB and before typing any other commands. Refer to the following link for more detailed instructions.
Hope this helps!
  1 个评论
n_luethen
n_luethen 2020-3-18
Hi,
thanks a lot for your answer! Unfortunately, Matlab apparently needs to be restarted for the rescaling to take effect: the message it is displaying when I change the DisplayScaleFactor, whether in startup.m or in the command window, is MATLAB must be restarted in order for the scale change to take effect. So putting the commands in startup.m is too late.
I still tried it, and there is no visible effect.
Is there any reason why my Matlab installation would not save PersonalValues or certain preferences?

请先登录,再进行评论。


Harsha Priya Daggubati
Hi,
I think it is advisable to restart MATLAB whenever the preferences are changed. I could assume the above based on the discussion in the following thread:

类别

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

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by