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

更多回答(2 个)

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

4 个评论

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?
instead of gca insert the handle for the axes you want to clear.
Thanks
It works like the cla(handles.im1)
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 个评论

Sorry, I am having difficulty understanding your question.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by