フィルターのクリア

error while clearing axes...

1 回表示 (過去 30 日間)
Elysi Cochin
Elysi Cochin 2012 年 11 月 9 日
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...

採用された回答

Walter Roberson
Walter Roberson 2012 年 11 月 9 日
arrayfun( @cla, setdiff( findall(0,'type','axes'), ax) );
  1 件のコメント
Elysi Cochin
Elysi Cochin 2012 年 11 月 9 日
thank u sir...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by