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

51 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 15 Ott 2024
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 Commenti
Jim Riggs
Jim Riggs il 4 Nov 2024
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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Desktop in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by