Since MATLAB R2006b, you can save breakpoints and reuse them in a later session by saving the status of breakpoints to a MAT-file using
and restoring the breakpoint status at a later time by loading the MAT-file using
which is a new option, introduced in MATLAB R2006b.
See the example in the dbstatus reference page of the documentation by running
Prior to MATLAB R2006b, you can workaround this issue by inserting the following line of code where you would like to set a breakpoint:
The keyboard function has the same functionality of a breakpoint, but it can be saved in the code.
Best Answer