MATLAB:更改命令窗口的字体大小
我想暂时更改 MATLAB 命令窗口中文本的字体大小。我正在进行一项实验,其中我站在实验室的另一边,需要偶尔从屏幕上读取数字。我不希望所有 MATLAB 输出永远都是巨大的——只是偶尔出现的这个变量。我想一定有一些代码可以增加字体大小?我知道我可以使用以下代码调整例如字体颜色:(
com.mathworks.services.Prefs.setColorPref('ColorsText',java.awt.Color.red);
com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsText');
上面将命令窗口中的文本更改为红色)。应该有类似的代码来设置字体大小吧?
理想的解决方案是向 fprintf 命令添加一个参数,这样只有输出的一位较大。但是,我会接受一种解决方案,其中屏幕的整个输出暂时变大......
任何帮助表示赞赏。
I would like to temporarily change the font size of the text in the command window of MATLAB. I am running an experiment in which I am standing at the other side of the lab, and need to occasionally read a number from the screen. I don't want all the MATLAB output to be jumbo size forever - just this one variable when it occasionally comes up. I expect there must be some code that increases font size? I know I can adjust for example font colour using the following code:
com.mathworks.services.Prefs.setColorPref('ColorsText',java.awt.Color.red);
com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsText');
(The above changes the text in the command window to red). There must be similar code to set font size?
The ideal solution would be a parameter to add to the fprintf command, such that only the one bit of output is larger. However, I would accept a solution in which the entire output of the screen is made larger temporarily...
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在图形中而不是命令行中显示所有输出怎么样?您可以放置文本对象并定义颜色和字体大小。
一种方法如下:
“文件 > 首选项 > 字体 > 自定义”,然后设置字体和大小。但它无法从命令行本身访问设置,因此您必须手动设置它,然后禁用它。
编辑:
弹出一个图形并打印出某个变量很容易:
如果您愿意,您还可以指定图形窗口本身的位置和大小。
要稍后关闭该图,只需使用:
如果您想更新它的值,只需使用类似
What about displaying all output in a figure instead of the command line? You could place text-objects and define colors and font sizes.
One way is the following:
"File > Preferences > Fonts > Custom" and there set your font and size. But it's not accessible setting from the commandline itsel so you would have to set it manually and afterwards disable it.
Edit:
To pop out a figure and print out a certain variable is easy:
you could also specify the position and size of the figure window itself, if you want to.
To close the figure later, just use:
If you want to update the value of it, just use something like
主页选项卡 ->环境选项卡 ->首选项->字体
HOME TAB -> ENVIRONMENT TAB -> Preferences -> Fonts