Desktop Tools and Development Environment Previous page   Next Page

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.


Previous page  Completing the Example Conditional Breakpoints Next page

© 1994-2005 The MathWorks, Inc.