フィルターのクリア

How to programmatically change the command window text size?

44 ビュー (過去 30 日間)
marcel hendrix
marcel hendrix 2024 年 7 月 18 日 14:12
回答済み: marcel hendrix 2024 年 7 月 21 日 17:50
It is of course possible to change the command window's text size by setting preferences, using the GUI. Is there a way to do the same programmatically by executing a MATLAB command or script? That would be much more convenient (I am calling MATLAB through engOpen() from C). At the moment MATLAB is using a 6-pixel font on my hi-dpi monitor (3840x2160), which is really inconvenient. The console has a menu bar, but it offers none of the functionality a normal OS cmd window has.

回答 (3 件)

Voss
Voss 2024 年 7 月 18 日 14:42
s = settings;
s.matlab.fonts.codefont.Size.PersonalValue = 16;
  4 件のコメント
VBBV
VBBV 2024 年 7 月 18 日 17:07
@marcel hendrix, it seems to work fine. Here's the difference you can notice if the change in fontsize settings is done from 10 to 16
marcel hendrix
marcel hendrix 2024 年 7 月 18 日 17:19
Of course that works. That is the GUI command window.
This is what I see after engOpen.

サインインしてコメントする。


Fangjun Jiang
Fangjun Jiang 2024 年 7 月 18 日 14:43
  2 件のコメント
marcel hendrix
marcel hendrix 2024 年 7 月 18 日 16:00
What I need could be in there, but I can't find it. Voss's answer concurs with the documentation but does nothing. I assume the setting is changed, but the engOpen command window has no handler / message loop for changed settings. What might be needed is a function that explicitly forces the engOpen console window to reinitialize or update its settings. I tried restarting MATLAB: it did not work, still a tiny font.
Fangjun Jiang
Fangjun Jiang 2024 年 7 月 18 日 16:36
In that case, you might want to try saving a pre-set settings to a folder and re-load it.

サインインしてコメントする。


marcel hendrix
marcel hendrix 2024 年 7 月 21 日 17:50
I found the perfect answer in the link below: no desktop font size .

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by