Clear Filters
Clear Filters

Detecting a hung command

3 views (last 30 days)
Jack
Jack on 11 May 2016
Answered: Walter Roberson on 11 May 2016
Hi All, I have a for loop in which I run a non-Matlab command... specifically, "findscu" which is part of the dicom toolkit:
for i=1:n
unix(['findscu ...'])
end
Unfortunately, this command hangs once in a while, sometimes a day later and sometimes a few hours. I have to constantly check to see if I need to ctrl-C and restart my code. Importantly, Matlab does not crash, rather, the findscu code just gets stuck searching indefinitely and does not progress to the next iteration of the loop. Can anyone think of a way in which I might be able to have a timeout such that I can force my code to error out after a certain time so that I can automatically go to the next iteration of the loop? thanks!

Answers (1)

Walter Roberson
Walter Roberson on 11 May 2016

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!