Effacer les filtres
Effacer les filtres

error while clearing axes...

1 vue (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 9 Nov 2012
while designing matlab GUI i inserted a background image in the GUI... i used the following code in the opening function to insert the background image...
% create an axes that spans the whole gui
ah=axes('unit','normalized','position',[0 0 1 1]);
%import the background image and show it on the axes
bg=imread('images.jpg');imagesc(bg);
% prevent plotting over the background and turn the axes off
set(ah,'handlevisibility','off');
%make sure that the background is behind all the uicontrols
uistack(ah,'bottom');
my GUI contains many axes... on the first execution everything works well... now when i load the input image the second time i wanted to clear all the axes... so i used the following code in the load image function....
arrayfun(@cla,findall(0,'type','axes'));
but when this is executed the background image i inserted also goes...what shud i do to retain the background image when all the other axes are being cleared...

Réponse acceptée

Walter Roberson
Walter Roberson le 9 Nov 2012
arrayfun( @cla, setdiff( findall(0,'type','axes'), ax) );
  1 commentaire
Elysi Cochin
Elysi Cochin le 9 Nov 2012
thank u sir...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by