Azzera filtri
Azzera filtri

error while clearing axes...

1 visualizzazione (ultimi 30 giorni)
Elysi Cochin
Elysi Cochin il 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...

Risposta accettata

Walter Roberson
Walter Roberson il 9 Nov 2012
arrayfun( @cla, setdiff( findall(0,'type','axes'), ax) );

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by