Notepad focus window

3 次查看(过去 30 天)
Tommie Heard
Tommie Heard 2011-3-18
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?

采纳的回答

Matt Fig
Matt Fig 2011-3-18
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Standard File Formats 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by