How do a pause execution within a file when a specific line produces a warning?
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Say I have a main file and a function file. I am getting a 'Matrix is singular, close to singular or badly scaled' warning and I would like to examine the inside of the function to find out what is causing this. So I want to pause the code on this error, view the variables within the function, and then investigate. How do I do this?
0 comentarios
Respuestas (2)
Walter Roberson
el 3 de Nov. de 2018
warning('error', 'MATLAB:singularMatrix')
dbstop if error
and run your code.
2 comentarios
Steven Lord
el 3 de Nov. de 2018
dbstop if warning
If you prefer to set this debugging condition via the UI, see the "Error Breakpoints" section of this documentation page.
0 comentarios
Ver también
Categorías
Más información sobre Debugging and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!