Automatically Entering Inputs into Program
Show older comments
Hi,
I am using an old program (Program.exe) that requires you to press ENTER, then enter inputs in the following order: 'A', 'B', 'C'
I have attemped this method: https://www.mathworks.com/matlabcentral/answers/381401-automatically-entering-inputs-into-executable-code-at-prompt
commandfile = fopen('commandfile.txt','w');
fprintf(commandfile,strcat('\n', 'A', '\n', 'B', '\n', 'C', '\n');
fclose(commandfile);
system('Program.exe < commandfile.txt');
My program then runs into the error LF90.EER error # 94" (this is listed as 'Data transfer beyond end of file').
I have also attemped this method: https://www.mathworks.com/matlabcentral/answers/516792-calling-executable-and-automatically-passing-input
commandfile = fopen('commandfile.txt','w');
fprintf(commandfile,strcat('\n', 'A', '\n', 'B', '\n', 'C', '\n');
fclose(commandfile);
system('echo commandfile.txt | Program.exe');
My program then runs into the error "ELF90.EER error # 124" (this is listed as 'Unable to read file').
Any insight would be very much appreciated.
1 Comment
Andrew Klingberg
on 30 Nov 2020
Edited: Andrew Klingberg
on 30 Nov 2020
Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!