dbstop if error: manually fixing the error and continue?
조회 수: 41 (최근 30일)
이전 댓글 표시
Hi all,
Let's say I toggle on the dbstop if error. And the matlab automatically stops at the error, is it possible for me to manually fix the error and continue the code execution (right from the place where Matlab stops, instead of re-running the code from the beginning)?
Thanks in advance!
Best, Liao
댓글 수: 0
채택된 답변
Jan
2013년 7월 2일
dbstop if error — Run-time error that occurs outside a try/catch block. You cannot resume execution after an uncaught run-time error.
추가 답변 (2개)
Youssef Khmou
2013년 7월 1일
hi,
Yes, if you put the command dbstop if error at the top of the M-file and run your code, when the compiler finds the error, the cursor indicates the line , then your press "F5", fix the error and re run, repeat the process until the code is error-free .
댓글 수: 3
Youssef Khmou
2013년 7월 1일
ok
You go to the menu of the M-file page, you click on cell and then enable cell mode , next you divide your code into parts using the notation %% in the beginning and end of each part, then this when a cursor is placed somewhere in specified cell, you click on evaluate cell in top right .
I hope this is clear,
More information can be found in the following page : http://blogs.mathworks.com/community/2009/06/08/using-the-cell-mode-toolbar/
per isakson
2013년 7월 1일
편집: per isakson
2013년 7월 1일
AFAIK: The answer is NO. It is not possible.
However,
- you can fix the line, but don't save
- select the line, right-click and Evaluate Selected (F9) to ensure that the fix works
- select lines before and after the fixed line and Evaluate Selected
But eventually you must save and re-run.
참고 항목
카테고리
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!