Clear the content of axes under panel using push button

7 vues (au cours des 30 derniers jours)
sandeep singh
sandeep singh le 22 Fév 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

Réponses (1)

Cris LaPierre
Cris LaPierre le 9 Avr 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.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by