If it is using CPU time then you could also use "ulimit -t"
Detecting a hung command
3 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!