Automatically Entering Inputs into Program
Mostrar comentarios más antiguos
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 comentario
Andrew Klingberg
el 30 de Nov. de 2020
Editada: Andrew Klingberg
el 30 de Nov. de 2020
Respuestas (0)
Categorías
Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!