How to clear getappdata setappdata variables or workspace?

How to clear getappdata setappdata variables or workspace? I am using getappdata and setappdata in callback functions, but it is not clearing when I rerun script? How to clear that workspace?

回答 (1 件)

Adam
Adam 2016 年 9 月 2 日

0 投票

Did you look at the help pages?
The 'See Also' section links to
doc rmappdata

6 件のコメント

Vishal Kulkarni
Vishal Kulkarni 2016 年 9 月 2 日
I want to clear all variables from the appdata...using rmappdata i can remove varibales specific to name...but how to clear....Like to clear base workspace we write just 'clear' likewise wthats there for appdata?
Adam
Adam 2016 年 9 月 2 日
Which graphics object are you setting the data on? IF you set it on any object other than groot it will clear automatically when that graphics object is deleted.
Vishal Kulkarni
Vishal Kulkarni 2016 年 9 月 12 日
I am not using it for graphics object..I am just using it for across function use.
Adam
Adam 2016 年 9 月 12 日
Whether you are using it for graphics objects or not as far as I am aware setappdata requires the handle of some graphics object as its first argument and that is what it attaches the data to.
Vishal Kulkarni
Vishal Kulkarni 2016 年 9 月 13 日
Got it, we can use it as
appdata = getappdata(0);
appdatavars= fieldnames(appdata);
We can clear required ones from them.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2016 年 9 月 2 日

コメント済み:

2016 年 9 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by