Clear the content of axes under panel using push button

8 visualizaciones (últimos 30 días)
sandeep singh
sandeep singh el 22 de Feb. de 2019
Respondida: Cris LaPierre el 9 de Abr. de 2019
Hello all ,
I have created a panel under which axes has been created, if i want to clear the content of the axes with the help of push button how can i do it.
cla (handle.......);, i am not able to write proper handle .
this is my peace of code.
DigitalImagePanel = uipanel(...
'Parent',GPT3MovablePanel,...
'FontUnits',get(0,'defaultuipanelFontUnits'),...
'Units',get(0,'defaultuipanelUnits'),...
'Title','',...
'BorderType','none',...
'Tag','uipanel',...
'FontSize',11,...
'Position',[0.0001 0.69 1.0 0.16]);
DigitalCompensatorImagePanel1 = uipanel(...
'Parent',DigitalImagePanel,...
'FontUnits',get(0,'defaultuipanelFontUnits'),...
'Units',get(0,'defaultuipanelUnits'),...
'Title','Z-Domain Cascaded T/F ',...
'Tag','uipanel11',...
'FontSize',11,...
'Position',[0.0001 0.5 0.5 0.50]);
ZDomainCascadedImageAX = axes(DigitalCompensatorImagePanel1,'Position',[0 0 1 1]);
ZDomainCascadedImage = imread('CascadedDisc.png');
imshow(ZDomainCascadedImage,'Parent',ZDomainCascadedImageAX);
set(ZDomainCascadedImageAX,'Units','pixels');
resizePosZDomainCascadedImageAX = get(ZDomainCascadedImageAX,'Position');
ZDomainCascadedImageResize=imresize(ZDomainCascadedImage, [resizePosZDomainCascadedImageAX(4) resizePosZDomainCascadedImageAX(3)]);
imshow(ZDomainCascadedImageResize,'Parent',ZDomainCascadedImageAX);
set(ZDomainCascadedImageAX,'Units','normalized');
thanks in advance

Respuestas (1)

Cris LaPierre
Cris LaPierre el 9 de Abr. de 2019
The code would be
cla(ZDomainCascadedImageAX)
Your issue is more likely related to variable scope. The pushbutton will have it's own callback function. You need to somehow pass the axes handle into the pushbutton callback. Since it looks like you are creating this app programmatically, consider looking at this example for how to achielve that.

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by