Desktop Tools and Development Environment |
Running Sections in M-Files That Have Unsaved Changes
It is a good practice to make changes to an M-file after you quit debugging, and to save the changes and then run the file. Otherwise, you might get unexpected results. But there are situations where you might want to experiment during debugging, to make a change to a part of the file that has not yet run, and then run the remainder of the file without saving the change.
To do this, while stopped at a breakpoint, make a change to a part of the file that has not yet run. Breakpoints will turn gray, indicating they are invalid. Then select all of the code after the breakpoint, right-click, and choose Evaluate Selection from the context menu. You can also use cell mode to do this.
Completing the Example | Conditional Breakpoints |
© 1994-2005 The MathWorks, Inc.