Normally when we have an error in script we see something like: "Error xxx (line x)".
But when there is an error in timer callback it shows:
Error while evaluating TimerFcn for timer 'timer-1'
Error xxx
From which I couldn't know which line went wrong.
Anyone know how I can locate the error?
Thanks

 채택된 답변

Jon
Jon 2021년 10월 21일

1 개 추천

I also have had a lot trouble with this. One thing that can help is to wrap the code where the problem occurs within a try catch and explicitly rethrow the error message. You can also put a debug breakpoint inside of the timer function and then step through to see where it goes wrong.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

태그

질문:

2021년 10월 21일

답변:

Jon
2021년 10월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by