How to programmatically change the command window text size?

조회 수: 9 (최근 30일)
marcel hendrix
marcel hendrix 2024년 7월 18일
댓글: marcel hendrix 2024년 7월 29일
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.

채택된 답변

marcel hendrix
marcel hendrix 2024년 7월 21일
I found the perfect answer in the link below: no desktop font size .
  댓글 수: 2
VBBV
VBBV 2024년 7월 29일
편집: VBBV 2024년 7월 29일
@marcel hendrix, The answer provided in the link doesn't mention about how to change the command window text size programmatically but rather tells about the use of mouse scroll and Ctrl keys
I guess your question is about how to obtain it using a set of commands ( programmatically ) and @Voss answer using the commands works perfectly fine.
marcel hendrix
marcel hendrix 2024년 7월 29일
Note that I open MATLAB from 'C' with the engOpen() call. The command window I get then has no GUI features. The
s = settings;
s.matlab.fonts.codefont.Size.PersonalValue = 16;
commands do nothing. However, the ^mousewheel trick indeed increases the fontsize for the duration of the session.
The above fixes my problem, although the programmable solution that I asked for originally would be even better, assuming it sticks even if I terminate the session and relaunch. The commands above do nothing, also not when I exit and relaunch MATLAB. They do seem to influence at least the code editor when I launch MATLAB with a GUI lateron. (This is actually unwanted because the font is much too large then.)

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Voss
Voss 2024년 7월 18일
s = settings;
s.matlab.fonts.codefont.Size.PersonalValue = 16;
  댓글 수: 4
VBBV
VBBV 2024년 7월 18일
@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일
Of course that works. That is the GUI command window.
This is what I see after engOpen.

댓글을 달려면 로그인하십시오.


Fangjun Jiang
Fangjun Jiang 2024년 7월 18일
  댓글 수: 2
marcel hendrix
marcel hendrix 2024년 7월 18일
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일
In that case, you might want to try saving a pre-set settings to a folder and re-load it.

댓글을 달려면 로그인하십시오.

카테고리

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