Automatically Entering Inputs into Program
Afficher commentaires plus anciens
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 commentaire
Andrew Klingberg
le 30 Nov 2020
Modifié(e) : Andrew Klingberg
le 30 Nov 2020
Réponses (0)
Catégories
En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!