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

 Akzeptierte Antwort

Weitere Antworten (2)

Paulo Silva
Paulo Silva am 10 Jul. 2011

1 Stimme

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

4 Kommentare

Kyle
Kyle am 10 Jul. 2011
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 am 10 Jul. 2011
instead of gca insert the handle for the axes you want to clear.
Kyle
Kyle am 10 Jul. 2011
Thanks
It works like the cla(handles.im1)
Yibiao
Yibiao am 19 Feb. 2015
It works, thanks!

Melden Sie sich an, um zu kommentieren.

norfaizayu
norfaizayu am 30 Jan. 2012

0 Stimmen

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 Kommentar

Walter Roberson
Walter Roberson am 30 Jan. 2012
Sorry, I am having difficulty understanding your question.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 10 Jul. 2011

Kommentiert:

am 19 Feb. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by