MATLAB Call exe program with input in Matlab(under cmd Environment)

  • Thread starter Thread starter alima2065
  • Start date Start date
  • Tags Tags
    Input Program
AI Thread Summary
The discussion revolves around using MATLAB to control an external executable program, 'Program.exe', through the SYSTEM command. The user initially struggles with sending commands to 'Program.exe' after launching it from MATLAB. The solution involves using the DOS command to add command-line parameters and creating a batch file, which effectively resolves the issue. The conversation highlights the importance of understanding how to structure input for external programs and the potential of batch files for automation.
alima2065
Messages
2
Reaction score
0
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
 
Physics news on Phys.org
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 said:
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
 

Similar threads

Replies
1
Views
4K
Replies
1
Views
4K
Replies
1
Views
3K
Replies
2
Views
10K
Replies
3
Views
3K
Back
Top