PDA

View Full Version : call exe program with input in Matlab(under cmd Environment)


alima2065
Aug7-11, 02:51 AM
Hi
I write M-file that call 'Program.exe' by SYESTEM command and go to the Program.exe Environment .now i need apply a command of 'Program.exe'. But i cannot control application with Matlab because Matlab go to 'Program.exe' Environment and 'Program.exe's command only is Executable and it is not automatically.

Thanks

Ali

MATLABdude
Aug9-11, 02:58 AM
Welcome to PhysicsForums!

Are you asking how to add command-line parameters to DOS-style commands? If so, you can do that with the dos command:
http://www.mathworks.com/help/techdoc/ref/dos.html

If you're asking how to put input into the program once launched, that may be more difficult. It probably depends on how the program is structured (or, even easier, whether the program can take read in input from a textfile or some such).

A batch file can also be quite powerful:
http://www.google.ca/search?q=write+batch+file+windows

alima2065
Aug9-11, 06:26 AM
Welcome to PhysicsForums!

Are you asking how to add command-line parameters to DOS-style commands? If so, you can do that with the dos command:
http://www.mathworks.com/help/techdoc/ref/dos.html

If you're asking how to put input into the program once launched, that may be more difficult. It probably depends on how the program is structured (or, even easier, whether the program can take read in input from a textfile or some such).

A batch file can also be quite powerful:
http://www.google.ca/search?q=write+batch+file+windows

MATLABdude thank you very much. my problem solved by batch file.
best regards