How do a pause execution within a file when a specific line produces a warning?
조회 수: 28 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Walter Roberson
2018년 11월 3일
warning('error', 'MATLAB:singularMatrix')
dbstop if error
and run your code.
Steven Lord
2018년 11월 3일
dbstop if warning
If you prefer to set this debugging condition via the UI, see the "Error Breakpoints" section of this documentation page.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!