Is there a way to clear all persistent variables in MATLAB functions, while keeping the breakpoints in the corresponding function files?
clear all;
and
clear functions;
both kill the breakpoints.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately, clearing persistent variables also clears breakpoints, but there is a workaround.
After setting the breakpoints you want to retain, use the
dbstatusfunction to get a structure containing those breakpoints and then save that structure to a MAT file. After clearing variables, you can then reload those variables by loading the MAT file and using dbstop. Following is an example of performing this sequence of operations: