dbstop if error: manually fixing the error and continue?
126 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Jan
on 2 Jul 2013
dbstop if error — Run-time error that occurs outside a try/catch block. You cannot resume execution after an uncaught run-time error.
More Answers (2)
Youssef Khmou
on 1 Jul 2013
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 .
per isakson
on 1 Jul 2013
Edited: per isakson
on 1 Jul 2013
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.
See Also
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!