How to monitor the MATLAB command window output to automate external script user input only in the event when prompted?
Mostrar comentarios más antiguos
I wrote a MATLAB function to automate several functions for my office that we perform on a Linux OS. The script fetches simulation logs from various servers, kicks off a Perl script that processes the logs into .mat files and then runs post analysis MATLAB tools on the resulting matfiles.
It's been working great until today when the Perl script hit a corner case and prompted the user for input on permission to rename a file. I'm guessing it was due to some permissions issue on those specific temp files. All the user has to do is hit enter to approve the prompt and because the shell command is executing through MATLAB, the input prompt is in the MATLAB command window. The log processing Perl script is kicked off using MATLAB's system command so as far as I know, "control" hasn't returned to MATLAB until the Perl script completes and it steps to the next line.
I know for typical MATLAB functions that require MATLAB user input, you can pass the function an answer file but is there any way I can have MATLAB dynamically assess what's in its command window from this Perl script shell output to see if this specific prompt appears and automate hitting enter for the user if it appears and do nothing if not?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown 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!