MATLAB Answers


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

SSOI SS 님이 질문을 제출함. 2 May 2014
최근 활동 per isakson 님이 댓글을 추가함. 14 May 2014
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();
rslt = 'error!!';
Anyone has an idea?

  댓글 수: 0

로그인 to comment.

답변 수: 1

Answer by per isakson
on 2 May 2014

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

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?

로그인 to comment.

Translated by