MATLAB Answers

Going to previous step while debugging

45 views (last 30 days)
Lalan on 12 May 2015
Commented: Lalan on 24 Jun 2015
How to go to previous step while debugging in matlab just like we use F10 for next step? Is there any such option?
Thanks - Lalan

Accepted Answer

Guillaume on 12 May 2015
You would think it would be something easy to implement in a interpreted language, but unfortunately, it's not possible to move the execution pointer to an arbitrary line in matlab.
You can only step forward I'm afraid.
Image Analyst
Image Analyst on 24 May 2015
This capability is called "edit and continue". I love it in Visual Studio and am frustrated it's not there in MATLAB. I use Walter's method of doing/undoing stuff in the command window while at a breakpoint.

Sign in to comment.

More Answers (1)

Robbin van Hoek
Robbin van Hoek on 12 May 2015
Not sure if it will help you since i don't know why you need to go back, but have a look at conditional breakpoints. This helped me a lot in the cases where i wanted to go back one step in debugging.
  1 Comment
Lalan on 24 Jun 2015
Thanks Hoek for the answer. I felt this necessity here. While debugging a program, I accidentally crossed a function where I needed to go inside that function. So I wanted to come back to previous step and step into that function.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!