有没有办法更改MATLAB Command Window的标题? [英] Is there a way to change the title of the MATLAB Command Window?
问题描述
我正在使用C ++ API来启动MATLAB(通过engOpenSingleUse).一切正常.但我想将窗口的标题从"MATLAB命令窗口"更改为其他名称.
I'm using the C++ API to fire up MATLAB (via engOpenSingleUse). Everything's working fine. But I'd like to change the title of the window from "MATLAB Command Window" to something else.
我经常打开其中的4个或5个,如果我的程序崩溃,偶尔会有一个变得孤立.如果我可以更改标题,则最好知道哪个是哪个.
I often have 4 or 5 of them open, and occasionally one gets orphaned if my program crashes. If I could change the title, I'd have a better shot of knowing which one was which.
是否可以执行MATLAB命令(通过engEvalString)来做到这一点?
Is there a MATLAB command I could execute (via engEvalString) that would do this?
推荐答案
对于Matlab 7:
For Matlab 7:
jDesktop = com.mathworks.mde.desk.MLDesktop.getInstance;
jDesktop.getMainFrame.setTitle('my new title');
*或专门用于命令窗口:
*or specifically for the Command Window:
cmdWin = jDesktop.getClient('Command Window');
cmdWin.getTopLevelAncestor.setTitle('my new title');
对于Matlab 6:
For Matlab 6:
jDesktop = com.mathworks.ide.desktop.MLDesktop.getMLDesktop;
jDesktop.getMainFrame.setTitle('my new title');
*或用于命令窗口:
cmdWin = jDesktop.getClient('Command Window');
cmdWin.getTopLevelWindow.setTitle('my new title');
其他相关的未记录桌面功能在这里进行了描述:
http://UndocumentedMatlab.com/blog/tag/desktop/
Other related undocumented desktop features are described here:
http://UndocumentedMatlab.com/blog/tag/desktop/
这篇关于有没有办法更改MATLAB Command Window的标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!