Is it possible to have matlab go into debugging mode only when it hits a nan?

6 views (last 30 days)
Is it possible to have matlab go into debugging mode only when it hits a nan, without writing code, just run and then halt when nan is detected using matlab IDE?

Answers (2)

Rik
Rik on 1 May 2018
dbstop IF NANINF

Guillaume
Guillaume on 1 May 2018
Edited: Guillaume on 1 May 2018
Have you looked at the documentation? It's right there in the documentation of dbstop
dbstop if naninf

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!