如何以代码的方式改变 MATLAB 的字体和大小?
107 views (last 30 days)
Show older comments
MathWorks Support Team
on 11 Sep 2020
Answered: MathWorks Support Team
on 11 Sep 2020
如何以代码的方式改变 MATLAB 的字体和大小?
Accepted Answer
MathWorks Support Team
on 11 Sep 2020
在R2018a及以后的新版本中,可以用代码的方式更改 MATLAB 命令行窗口和函数编辑窗口中的字体和大小。参考:
例子:
>>s = settings;
>>s.matlab.fonts.codefont.Size.TemporaryValue = 12; % points
将字的大小设置为12
>>clearTemporaryValue(s.matlab.fonts.codefont.Size);
还原原来的字体
需要说明的是,TemporaryValue是临时性的修改,重启 MATLAB 后失效。如果希望一直保持,需要使用 PersonalValue。例子:
>>s = settings;
>>s.matlab.fonts.codefont.Size.PersonalValue = 12;
这个修改即使在重启后也有效
>>clearPersonalValue(s.matlab.fonts.codefont.Size);
还原原来的字体
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!