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?
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With