views:

55

answers:

2

I am using a trans.exe file, which when run asks for a parameter (=input) file. If I run trans.exe using Matlab, then how can I directly give the parameter file inside the program without being prompted by Matlab to type it manually each time trans.exe is run?

+1  A: 

If your executable doesn't have the ability to accept command-line parameters, then your only option is to invoke a call which pipes stuff to the stdin of your executable (under Linux, this would be something like !echo "blah blah blah" | my_executable). I don't know if this technique works from Matlab, though.

Oli Charlesworth
A: 

system('"C:\path_name\trans.exe" < "C:\path_name\input_trans_parameter_file.txt"');

The following command line used in above system function directly uses the name of the input file stored in input_trans_parameter_file.txt.

< "C:\path_name\input_trans_parameter_file.txt"

Harpreet

related questions