Can "Pause on Errors" be enabled by a script, or set as the default?

조회 수: 52 (최근 30일)
I run many processes that take a day or more to run, and sometimes they encounter unexpected errors. I don't always think to turn on "Pause on Errors", but when an error ocurrs, I wish that I had. Is there a way to set this in my script, or configue MATLAB such that this is the default behavior?

채택된 답변

Walter Roberson
Walter Roberson 2024년 10월 15일
dbstop if error
It is sometimes useful to use
dbstop if caught error
However, it turns out that caught errors are expected in routines such as ode45() and integrate() so it can get a bit frustrating to deal with all the caught errors sometimes.
  댓글 수: 3
Jim Riggs
Jim Riggs 2024년 11월 4일
I appreciate the comments and insights. Thank you very much.
But my code is designed to run in deployed mode, and try/catch is not compatible with the MATLAB coder, so I cannot use this construct.
Walter Roberson
Walter Roberson 2024년 11월 4일
Pausing on error is not compatible with MATLAB Coder.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by