From: Kevin on 1 Mar 2010 20:15 Assuming that I have my matlab command window and the figure window placed side-by-side. Also assume that I already opened figure 1 in the figure window. After I typed "figure(1)" and hit Enter in the command window, figure 1 will be the focus and highlighted. I can click in the command window to re-focus back to the command window. Can I do this last step programmatcially?
From: Jan Simon on 1 Mar 2010 21:49 Dear Kevin! > Assuming that I have my matlab command window and the figure window placed side-by-side. Also assume that I already opened figure 1 in the figure window. > > After I typed "figure(1)" and hit Enter in the command window, figure 1 will be the focus and highlighted. I can click in the command window to re-focus back to the command window. Can I do this last step programmatcially? See COMMANDWINDOW. Kind regards, Jan
From: Kevin on 2 Mar 2010 11:28 Wow, thanks for the help. I am still learning new Matlab command after using Matlab for so many years. Since this is possible, I have 2 more questions: (1) Can I do the same thing with editor? (2) Assuming that I have the command window on the left side of my computer screen, editor in the middle and figure on the right, is it possible to find out programmatcially whether the user is working in the command window or editor? "Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hmhub1$5ma$1(a)fred.mathworks.com>... > Dear Kevin! > > > Assuming that I have my matlab command window and the figure window placed side-by-side. Also assume that I already opened figure 1 in the figure window. > > > > After I typed "figure(1)" and hit Enter in the command window, figure 1 will be the focus and highlighted. I can click in the command window to re-focus back to the command window. Can I do this last step programmatcially? > > See COMMANDWINDOW. > Kind regards, Jan
From: Jan Simon on 2 Mar 2010 18:14 Dear Kevin! > Wow, thanks for the help. I am still learning new Matlab command after using Matlab for so many years. > > Since this is possible, I have 2 more questions: > > (1) Can I do the same thing with editor? > > (2) Assuming that I have the command window on the left side of my computer screen, editor in the middle and figure on the right, is it possible to find out programmatcially whether the user is working in the command window or editor? Please set your answers *under* the original text. To access the editor, use the tools published by Yair: http://undocumentedmatlab.com/blog/accessing-the-matlab-editor/ There you find: desktop = com.mathworks.mde.desk.MLDesktop.getInstance; jEditor = desktop.getGroupContainer('Editor').getTopLevelAncestor; Bring the editor to front: jEditor.toFront; Is the editor active currently: jEditor.isActive; Perform an action whenever the user activate the editor: set(jEditor, 'WindowGainFocusCallback', 'disp(''Editor activated'')') Or the usual function handle callback style. See further properties: get(jEditor) and methods(jEditor, '-full') Have fun, Jan
|
Pages: 1 Prev: Loading an image WITHOUT image processing toolbox Next: DCC GARCH forecasting code |