Running external program from Matlab for a given amount of time
Afficher commentaires plus anciens
Hello all!
I've got the following problem:
My code opens an external program (using "dos" command) and makes it process a certain data file, it looks like this:
dos('<path_to_program>\program -i <path_to_input_file>\input_file &')
"&" sign allows Matlab to open multiple instances of that program at the same time, as it returns control to Matlab immediately after starting the program and the code above is nested in a for loop, in which the input_file name is changing, so that a couple of files can be processed simultaneously.
Now, my question is, is it possible to limit the time of execution of that external program? I don't have to worry about saving it's results, as they're being written to an output file on the go.
Let's say, I would like each instance of that external program to run for an hour and then just close.
I would very much appreciate help on this one.
All the best
Filip
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Startup and Shutdown 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!