How can I clear persistent variables without clearing breakpoints?

I need to be able to clear the persistent data in my MATLAB files, but want to avoid clearing break points at the same time. Something like "clear persistent" would be ideal.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2011 年 1 月 6 日

0 投票

The ability to clear persistent variables without clearing breakpoints does not exist in MATLAB. All the means to clear persistent data also clear the breakpoints.
As a workaround, you can clear all functions and then add the breakpoints back again by executing the following function:
function testBreakPoints
a = dbstatus;
clear functions
dbstop(a);
end
For this workaround to work, it is required that all files that contain breakpoints are on the MATLAB Search Path.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

リリース

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by