필터 지우기
필터 지우기

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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by