Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Hidden command window

Subject: Hidden command window

From: Miroslav Balda

Date: 14 Jan, 2009 20:55:06

Message: 1 of 18

Is there a command in Matlab, which is able to make the matlab window with command window visible, if hidden by a full-screen figure window?
Thanks,
Mira

Subject: Hidden command window

From: Matt Fig

Date: 14 Jan, 2009 21:04:01

Message: 2 of 18

"Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <gkljfa$js6$1@fred.mathworks.com>...
> Is there a command in Matlab, which is able to make the matlab window with command window visible, if hidden by a full-screen figure window?
> Thanks,
> Mira

How would you enter the command? At the command line? Alt+tab works pretty well.

Subject: Hidden command window

From: Miroslav Balda

Date: 14 Jan, 2009 21:19:03

Message: 3 of 18

"Matt Fig" <spamanon@yahoo.com> wrote in message <gklk01$ohc$1@fred.mathworks.com>...
> "Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <gkljfa$js6$1@fred.mathworks.com>...
> > Is there a command in Matlab, which is able to make the matlab window with command window visible, if hidden by a full-screen figure window?
> > Thanks,
> > Mira
>
> How would you enter the command? At the command line? Alt+tab works pretty well.

Sorry, but Alt+Tab is not a command. It is a manual action.
Let us have a running program, which generates a full-screen window with a figure. It covers the Matlab window. If the program needs some manual data, a message of the program appears on the hidden window, and the program is waiting on user response, but the user does not know about it. In that case, it would be good to have a command in the program, just before a display of any requirement on the screen, which would put command window in foreground. It is all. Any idea?
Mira

Subject: Hidden command window

From: Jan Simon

Date: 14 Jan, 2009 21:22:02

Message: 4 of 18

Dear Mira!

> Is there a command in Matlab, which is able to make the matlab window with command window visible, if hidden by a full-screen figure window?

On Windows and Matlab 7 you can try:
  mainWindow = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
  mainWindow.toFront;

Good luck, Jan

Subject: Hidden command window

From: Matt Fig

Date: 14 Jan, 2009 21:25:03

Message: 5 of 18

I see. I don't know if you can bring the command window to the front. How about setting the figure's visible property to off, getting the input, then setting the figure's visible property to on?

Subject: Hidden command window

From: Steven Lord

Date: 14 Jan, 2009 21:40:11

Message: 6 of 18


"Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message
news:gkljfa$js6$1@fred.mathworks.com...
> Is there a command in Matlab, which is able to make the matlab window with
> command window visible, if hidden by a full-screen figure window?

COMMANDWINDOW?

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/commandwindow.html

--
Steve Lord
slord@mathworks.com

Subject: Hidden command window

From: Matt Fig

Date: 14 Jan, 2009 21:47:01

Message: 7 of 18

"Steven Lord" <slord@mathworks.com> wrote in message
> COMMANDWINDOW?
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/commandwindow.html
>
> --
> Steve Lord
> slord@mathworks.com


I learn something new everyday. Thanks!

Subject: Hidden command window

From: Miroslav Balda

Date: 14 Jan, 2009 21:50:18

Message: 8 of 18

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <gkll1q$627$1@fred.mathworks.com>...
> Dear Mira!
>
> > Is there a command in Matlab, which is able to make the matlab window with command window visible, if hidden by a full-screen figure window?
>
> On Windows and Matlab 7 you can try:
> mainWindow = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
> mainWindow.toFront;
>
> Good luck, Jan

Hello Jan,
I tried your statements in different positions inthe following script:

mainWindow = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
mainWindow.toFront;
fig(5); % FEX 9035
x=0:10;
plot(x,x.^2)
%mainWindow = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
%mainWindow.toFront;
x = input('test = ')

You see, that I tested several positions of your commands, nevertheless with the same result: The Matlab command window does not appear, and the program waits for the input on the command window.
Do the command be in other positions?
Mira

Subject: Hidden command window

From: Miroslav Balda

Date: 14 Jan, 2009 21:54:02

Message: 9 of 18

"Matt Fig" <spamanon@yahoo.com> wrote in message <gklmgl$enf$1@fred.mathworks.com>...
> "Steven Lord" <slord@mathworks.com> wrote in message
> > COMMANDWINDOW?
> >
> > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/commandwindow.html
> >
> > --
> > Steve Lord
> > slord@mathworks.com
>
>
> I learn something new everyday. Thanks!

Hi Steven,
I thank you very much. It is the very hint. I thank also Matt and Jan.
Good night, if you are from Europe.

Mira

Subject: Hidden command window

From: Miroslav Balda

Date: 15 Jan, 2009 07:58:03

Message: 10 of 18

"Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <gklmtp$cbp$1@fred.mathworks.com>...
> "Matt Fig" <spamanon@yahoo.com> wrote in message <gklmgl$enf$1@fred.mathworks.com>...
> > "Steven Lord" <slord@mathworks.com> wrote in message
> > > COMMANDWINDOW?
> > >
> > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/commandwindow.html
> > >
> > > --
> > > Steve Lord
> > > slord@mathworks.com
> >
> >
> > I learn something new everyday. Thanks!
>
> Hi Steven,
> I thank you very much. It is the very hint. I thank also Matt and Jan.
> Good night, if you are from Europe.
>
Hi,
Yesterday, I enjoyed too early. The code with the command commandwindow

 % CMDWIN Test of displaying hidden command window
close all
fig(5); % FEX 9035
x=0:10;
plot(x,x.^2)
commandwindow
%set(gcf,'visible','off')
x = input('test = ')
%set(gcf,'visible','on')

doesn't put the command window in front.
Fortunately, the Matt recommendation works, as seen, when uncomment both set commands. It doesn't put the command window in front, however, it enables to see it and enter the originally hidden input. Just after an input the figure appears and hidds again the command window. OK. At least some solution.
Thanks.
Mira

Subject: Hidden command window

From: Jan Simon

Date: 19 Jan, 2009 21:14:02

Message: 11 of 18

Dear Mira!
On my computer (WinXP) the toFront command works as expected. Perhaps it depends on the operating system?!

I do not have access to Matlab 7 currently, but in version 5 and 6 there was a command (without documentation, i think):
  uimenufcn(gcf, 'WindowCommandWindow')

Good luck again, Jan

Subject: Hidden command window

From: Miroslav Balda

Date: 20 Jan, 2009 21:04:02

Message: 12 of 18

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <gl2qeq$ipp$1@fred.mathworks.com>...
> Dear Mira!
> On my computer (WinXP) the toFront command works as expected. Perhaps it depends on the operating system?!
>
> I do not have access to Matlab 7 currently, but in version 5 and 6 there was a command (without documentation, i think):
> uimenufcn(gcf, 'WindowCommandWindow')
>
> Good luck again, Jan

Dear Jan,

I thank you for your message. I have tested your recommendation
     uimenufcn(gcf, 'WindowCommandWindow')
as first, however, without success. I have windows Vista home Premium and I use Matlab 2006b at home. I tested it also in the office, where i have Windows XP Professional. Again without any success. Then, I tried a script:

h = fig(5); % FEX id 9033
x = 1:10;
plot(x,x.^2)
mainWindow = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
mainWindow.toFront;
input('number = ');

The command window remained under the figure window. Sorry, am I doing an error in the order of commands?
Anyway, I thank you for your active approach to my problem.

Best regards,
Mira

Subject: Hidden command window

From: Matt Fig

Date: 20 Jan, 2009 23:35:04

Message: 13 of 18

Hello,
I am wondering if an inputdlg might be the way to go for what you want.


figure; % for example.
x=0:10;
plot(x,x.^2)
pause(1) % To increase the anticipation.
prompt={'test = '};
name='Input the test number';
numlines=1;
defaultanswer={''};
% Gives a string!!
x=inputdlg(prompt,name,numlines,defaultanswer);




gM-IPIW\nKMVP5"WVAXgJXW^WOgP\gugKaITg(U\JIMQIQgnSW]WMUIIg]T

Subject: Hidden command window

From: Miroslav Balda

Date: 21 Jan, 2009 16:47:02

Message: 14 of 18

"Matt Fig" <spamanon@yahoo.com> wrote in message <gl5n38$kih$1@fred.mathworks.com>...
> Hello,
> I am wondering if an inputdlg might be the way to go for what you want.
>
>
> figure; % for example.
> x=0:10;
> plot(x,x.^2)
> pause(1) % To increase the anticipation.
> prompt={'test = '};
> name='Input the test number';
> numlines=1;
> defaultanswer={''};
> % Gives a string!!
> x=inputdlg(prompt,name,numlines,defaultanswer);
>
> gM-IPIW\nKMVP5"WVAXgJXW^WOgP\gugKaITg(U\JIMQIQgnSW]WMUIIg]T

Hello,
I thank you, Matt, for a submitted solution. It is solving the problem only partially.
1. It doesn't put command window to front.
2. It doesn't make any trace in diary.
3. The window should be mose driven when accepting an input.

On the opposite side, it allows to anounce the user that the input is waiting, and enables to assign a default value. It helps to overcome certain lack of efficiency.
I think that this inability of Matlab to open command window via a command should be withdrawn.
Best regards,
Mira

Subject: Hidden command window

From: Jan Simon

Date: 22 Jan, 2009 21:17:18

Message: 15 of 18

Dear Mira!
I am really confused now. You said, that the mentioned methods do not work. Are there errors? The named uimenufcn is the function, Matlab uses if you press the 1st entry of the Window menu of a figure. Are you able to activate this menu and lift the command window at least manually?!

The last idea I have is ShowWindow from the Matlab FileExchange:
http://www.mathworks.com/matlabcentral/fileexchange/3407
This let the operating system touch the window's properties. It works for the command window as for all other windows, as long as it has a uniqe name.

Finally I think, "fig(5)" is the problem. Can you try to replace this by the corresponding ShowWindow method?
Matlab 6.5 got very confused, if parts of the Window grow outside the display area, perhaps 7.3 has similar limitations.

Good luck, Jan

Subject: Hidden command window

From: Jan Simon

Date: 22 Jan, 2009 21:17:18

Message: 16 of 18

Dear Mira!
I am really confused now. You said, that the mentioned methods do not work. Are there errors? The named uimenufcn is the function, Matlab uses if you press the 1st entry of the Window menu of a figure. Are you able to activate this menu and lift the command window at least manually?!

The last idea I have is ShowWindow from the Matlab FileExchange:
http://www.mathworks.com/matlabcentral/fileexchange/3407
This let the operating system touch the window's properties. It works for the command window as for all other windows, as long as it has a uniqe name.

Finally I think, "fig(5)" is the problem. Can you try to replace this by the corresponding ShowWindow method?
Matlab 6.5 got very confused, if parts of the Window grow outside the display area, perhaps 7.3 has similar limitations.

Good luck, Jan

Subject: Hidden command window

From: Miroslav Balda

Date: 22 Jan, 2009 23:34:01

Message: 17 of 18

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <glanou$9ne$1@fred.mathworks.com>...
> Dear Mira!
> I am really confused now. You said, that the mentioned methods do not work. Are there errors? The named uimenufcn is the function, Matlab uses if you press the 1st entry of the Window menu of a figure. Are you able to activate this menu and lift the command window at least manually?!
>
> The last idea I have is ShowWindow from the Matlab FileExchange:
> http://www.mathworks.com/matlabcentral/fileexchange/3407
> This let the operating system touch the window's properties. It works for the command window as for all other windows, as long as it has a uniqe name.
>
> Finally I think, "fig(5)" is the problem. Can you try to replace this by the corresponding ShowWindow method?
> Matlab 6.5 got very confused, if parts of the Window grow outside the display area, perhaps 7.3 has similar limitations.
>
> Good luck, Jan

Dear Jan!
I tried the earlier methods several times in different positions in the code without success and without errors. It simply passed through doing nothing.
Yes, as soon as I touched any key on the keyboard the command window appears.

I downloaded showwindow function a tested it a bit a while ago:

close all
showwindow('MATLAB 7.3.0 (R2006b)','shownormal')
x = 1:10;
figure
plot(x,x.^2)
showwindow('Figure 1','shownormal')
pause(.1)
showwindow('Figure 1','maximize') % this works only after pause
pause(3) % Some "program"
% showwindow('Figure 1','minimize') % this works
showwindow('Figure 1','hide') % this works
input('number = ');
showwindow('Figure 1','maximize') % this works
% showwindow('Figure 1','restore') % this works
pause(3)
showwindow('MATLAB 7.3.0 (R2006b)','shownormal') % this doesn't work

No one attempt brought the command window to front, however, i allowed to see it and to enter data.
I thank you for your help. Even that I am working with MATLAB years, I lerned again something more. Thanks.
Best regards

Mira

Subject: Hidden command window

From: ollydbg

Date: 9 Apr, 2009 13:33:02

Message: 18 of 18

This problem has the solution. See the thread:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/248704

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us