dbstopif(condition)

Version 1.0.0.0 (981 octets) par Dan K.
dbstopif is a much faster replacement for the built in conditional breakpoint
24 téléchargements
Mise à jour 16 mai 2017

Afficher la licence

When working with long loops of processing one may need to set a breakpoint to stop on a particular condition. While Matlab's built in conditional breakpoints achieve this, they exact a heavy performance penalty (even when disabled!), and are not generally maintained between sessions. dbstopif is inserted as a single line of code which which, if the condition is true, sets a regular breakpoint on the following line, resulting in an immediate dbstop.
A comparison of the time to execute a loop with many iterations:

Matlab conditional breakpoint enabled: Elapsed time is 34.412000 seconds.
dbstopif: Elapsed time is 0.004994 seconds.

Disabled:
Matlab conditional breakpoint disabled: Elapsed time is 51.132263 seconds.
dbstopif: Elapsed time is 0.004941 seconds.

Matlab conditional breakpoint removed: Elapsed time is 0.004422 seconds.
dbstopif: Elapsed time is 0.004628 seconds.

Citation pour cette source

Dan K. (2025). dbstopif(condition) (https://fr.mathworks.com/matlabcentral/fileexchange/62969-dbstopif-condition), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2017a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Programming dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0