Azzera filtri
Azzera filtri

Is there a command that will refocus the active window back to the command window in Matlab's GUI?

13 visualizzazioni (ultimi 30 giorni)
I am trying to use a script (script A) that prints a letter to the active window every 2 seconds to test the timing of one of my scripts (script B). I have just noticed that when I run script B on a second monitor, so I can see the Psychtoolbox window and the Matlab window, script A finally works when I click on the command window after the Psychtoolbox window flips.
It won't be a perfect fix but if I can find a command (or a functions I can write to mimic this) it should solve the problem for now. I have quizzed the Psychtoolbox boards, as well, in case I can't find an answer here.
I have also found a bunch of questions on this board that are similar to the one I am asking, but they all regard focus shifts from a figure created by MatLab. I am going to try the options given in those answers but as I am not dealing with a figure I believe it won't fix the problem.
  1 Commento
Jan
Jan il 30 Lug 2019
Please mention, what "prints a letter to the active window" exactly means. How do you "run a script on a 2nd monitor"?! Monitors cannot run scripts.What ist "the Matlab window"? What does "the Psychtoolbox window flips" mean?
I do not understand, what you want to achieve, what are you doing currently and which problem you have.

Accedi per commentare.

Risposte (1)

Adam Danz
Adam Danz il 30 Lug 2019
Modificato: Adam Danz il 30 Lug 2019
commandwindow() % no inputs
% Will make the command window the active window.
% That is, if you start typing, the text will be
% entered in the command window.
But I agree with Jan that your goal is unclear.

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by