How to change the window title of Matlab with -nodesktop mode on

Hello all,
I am currently trying to handle multiple Matlab from the command line (Windows). When using Matlab in normal mode, I can easily track the target Matlab by changing the window title, by using com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame.setTitle('TARGETMATLAB').
The problem arises when trying to do the same with Matlab with -nodesktop option on. As the command above says "Attempt to reference field of non-structure array."
My current undestanding is that somewhat the MainFrame has changed since if I do com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame() It returns an empty string, instead of the Main Frame object.
Anyone has faced this issue before?

답변 (1개)

Orion
Orion 2014년 10월 13일
Hi,
I never tried to do this, but when I want to get (or change) the title of the Matlab Window, I use an other command :
com.mathworks.mlservices.MatlabDesktopServices.getDesktop.getMainFrame.getTitle
...
com.mathworks.mlservices.MatlabDesktopServices.getDesktop.getMainFrame.setTitle('TARGETMATLAB')
Maybe, it will solve your problem ?

댓글 수: 1

Hello Orion,
The command you suggested has the same effect because "com.mathworks.mlservices.MatlabDesktopServices.getDesktop.getMainFrame" returns empty.
I think the issue is that I am trying to find the name of the Desktop window and what a really need is to get the name of the Command Window, since the -nodesktop option only opens a MATLAB Command Window.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2014년 10월 13일

댓글:

2014년 10월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by