Hi,
Is there another way to clear image in axes beside using the following code?
cla(handles.im1,'reset')
If i use this, it even clears the ButtonDownFcn of my axes.
Thanks

 採用された回答

Robert Cumming
Robert Cumming 2011 年 7 月 10 日

1 投票

cla(handles.im1)

その他の回答 (2 件)

Paulo Silva
Paulo Silva 2011 年 7 月 10 日

1 投票

Just delete the children of the current axes
delete(get(gca,'Children'))
The buttondownfcn of the axes remains unchanged

4 件のコメント

Kyle
Kyle 2011 年 7 月 10 日
i'm using a Clear button to clear off all image on the GUI. erm with ur code how to specify which axes to clear?
Paulo Silva
Paulo Silva 2011 年 7 月 10 日
instead of gca insert the handle for the axes you want to clear.
Kyle
Kyle 2011 年 7 月 10 日
Thanks
It works like the cla(handles.im1)
Yibiao
Yibiao 2015 年 2 月 19 日
It works, thanks!

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

norfaizayu
norfaizayu 2012 年 1 月 30 日

0 投票

i cannot run the source code. is it just put the coding?i have 3 axes to be clear in gui. so how can i clear it?

1 件のコメント

Walter Roberson
Walter Roberson 2012 年 1 月 30 日
Sorry, I am having difficulty understanding your question.

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

カテゴリ

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

質問済み:

2011 年 7 月 10 日

コメント済み:

2015 年 2 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by