Borrar filtros
Borrar filtros

error while clearing axes...

1 visualización (últimos 30 días)
Elysi Cochin
Elysi Cochin el 9 de Nov. de 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...

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by