Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Create a function which can stop itself if its internal function gives no reaction within XX seconds ??

조회 수: 1 (최근 30일)
Hi, I am just wondering if there is any way to impletment a function like this:
function rslt = example1()
% start call main function
...
try % start followin function, if no feedback within XX seconds, then catch the error
% call function another thread
rslt = callback();
catch
rslt = 'error!!';
end
...
end
Anyone has an idea?
Thnks

답변 (1개)

per isakson
per isakson 2014년 5월 2일
AKAIK: There is no simple way to do that.
We discussed a function, watchdog, in another thread a year ago. I think you could apply the approach of my watchdog_demo. (The conditional break point must be set at an appropriate line in your function, callback.)
  댓글 수: 2
SSOI SS
SSOI SS 2014년 5월 14일
The problem is that the script will be hold at that place with arrow using dbstop, but not able to throw out error warning etc. Anyway to do this?

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by