- Sep 10, 2001
- 12,348
- 1
- 81
I have a compiled command line program that I need to run with a bunch of different input files. When the program runs, it waits for a command line entry for the input text file. Once this input is made, it runs until it's done.
What I would like to do is automate the process using MATLAB. I thought the easiest thing to do would be to make a simple batch file which opens the program and gives it the input filename it needs to run. I can then simply write a new input file each time I need to change the parameters. However, I have no batch file experience and I've tried everything I can find to give it the input it needs, including:
Both initiate prog.exe. The first causes the program to crash, giving the error "forrtl: severe (24): end-of-file during read, unit -4, file CONIN$". The second simply prompts me for the input file name; "input.inp" is then entered at the command prompt once prog.exe exits, opening input.inp in Windows.
I have also tried using the "dos" and "system" functions in MATLAB, but it just hangs after opening prog.exe. Any ideas would be greatly appreciated.
What I would like to do is automate the process using MATLAB. I thought the easiest thing to do would be to make a simple batch file which opens the program and gives it the input filename it needs to run. I can then simply write a new input file each time I need to change the parameters. However, I have no batch file experience and I've tried everything I can find to give it the input it needs, including:
- "prog.exe" < input.inp
- "prog.exe"
"input.inp"
Both initiate prog.exe. The first causes the program to crash, giving the error "forrtl: severe (24): end-of-file during read, unit -4, file CONIN$". The second simply prompts me for the input file name; "input.inp" is then entered at the command prompt once prog.exe exits, opening input.inp in Windows.
I have also tried using the "dos" and "system" functions in MATLAB, but it just hangs after opening prog.exe. Any ideas would be greatly appreciated.