Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change the title of the MATLAB Command Window?

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.

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.

Is there a MATLAB command I could execute (via engEvalString) that would do this?

like image 748
Eric H. Avatar asked Dec 18 '22 04:12

Eric H.


1 Answers

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');

For Matlab 6:

jDesktop = com.mathworks.ide.desktop.MLDesktop.getMLDesktop;
jDesktop.getMainFrame.setTitle('my new title');

*or for the Command Window:

cmdWin = jDesktop.getClient('Command Window');
cmdWin.getTopLevelWindow.setTitle('my new title');


Other related undocumented desktop features are described here:
http://UndocumentedMatlab.com/blog/tag/desktop/

like image 165
Yair Altman Avatar answered Jan 25 '23 23:01

Yair Altman