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

  • Context: MATLAB 
  • Thread starter Thread starter alima2065
  • Start date Start date
  • Tags Tags
    Input Program
Click For Summary
SUMMARY

This discussion addresses the challenge of executing 'Program.exe' from MATLAB using the SYSTEM command and controlling its input. The user initially struggled with sending commands to the executable after launching it. The solution provided involves using the MATLAB dos command to add command-line parameters and leveraging batch files for more complex input handling. The user confirmed that their issue was resolved by implementing a batch file.

PREREQUISITES
  • Familiarity with MATLAB's SYSTEM command
  • Understanding of command-line parameters in Windows
  • Basic knowledge of batch file creation
  • Awareness of how executables handle input
NEXT STEPS
  • Research how to use MATLAB's dos command for executing external programs
  • Learn about creating and using batch files in Windows
  • Explore methods for passing input to executables via text files
  • Investigate the structure of 'Program.exe' to determine input handling capabilities
USEFUL FOR

This discussion is beneficial for MATLAB users, software developers, and anyone needing to integrate external executables with MATLAB for automation or data processing tasks.

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 19 ·
Replies
19
Views
6K
  • · Replies 3 ·
Replies
3
Views
13K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
1
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K