Notepad focus window

2 visualizzazioni (ultimi 30 giorni)
Tommie Heard
Tommie Heard il 18 Mar 2011
Here is what I am using to open a text file in MATLAB.
command = sprintf ( 'notepad %s', fullpathOfYourFile ); System ( command )
However, when it opens the notepad filename, the focus return to my figure and my filename goes in the background. I want my file that I opened to be the focus.
Can someone help me?

Risposta accettata

Matt Fig
Matt Fig il 18 Mar 2011
It works here.
command = sprintf ('notepad %s', [pwd,'\myfile.m']);
system (command);
Did you mean that you want MATLAB to return after the notpad file is opened instead of remaining 'Busy'? Then add an & to the command.
command = sprintf ('notepad %s', [pwd,'\myfile.m', '&']);
system (command);

Più risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by