Timeout for system function

17 views (last 30 days)
Simon on 27 May 2016
Answered: Walter Roberson on 27 May 2016
I can execute a Python-Script with the MATLAB function system(commandStr).
I loop a set of data like:
for i=1:100
commandStr = ['python myscript.py ' num2str(i)];
[status, commandOut] = system(commandStr);
Sometimes, the Python Script can't find a solution. In this case the next "i" never will be calculated. To avoid this, I like to use a timeout option. If there is no solution in x sec, go to the next i.
Thank you for your help.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!