Find unsuppressed outputs in R2024b using dbstop


It's frustrating when a long function or script runs and prints unexpected outputs to the command window. The line producing those outputs can be difficult to find.
Starting in R2024b, use dbstop to find the line with unsuppressed outputs!
Run this line of code before running the script or function. Execution will pause when the line is hit and the file will open to that line. Outputs that are intentionaly displayed by functions such as disp() or fprintf() will be ignored.
dbstop if unsuppressed output
To turn this off,
dbclear if unsuppressed output
Stephen23
Stephen23 am 30 Okt. 2024
Hurrah, this is great news! Time for me to update some old Answers threads :)
DGM
DGM am 30 Okt. 2024
If you know of a good thread or two, I'd appreciate it if you could link them here. (I'm having trouble finding much)
Stephen23
Stephen23 am 6 Feb. 2025
Steve Eddins
Steve Eddins am 30 Okt. 2024

This is one of my favorites in R2024b.

goc3
goc3 am 30 Okt. 2024
That is helpful.
This would also be a great option in the Run-button options to toggle on or off, along with Pause on Errors, Pause on Warnings, etc. Or, perhaps that option exists and I have not yet found it.
Michelle Hirsch
Michelle Hirsch am 30 Okt. 2024
We added this in the new desktop beta in 24b, but not the regular desktop.
Chen Lin
Chen Lin am 30 Okt. 2024
Great to see more quick tip! Thanks for sharing, Adam.

Tags

Noch keine Tags eingegeben.