GUI axes handle

조회 수: 38 (최근 30일)
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 8일
hi all, i want to ask how we set axes handle in a loop
e.g:
i want to show images in two axes according to their order, in axes 1 i wan to show image1 and soon..
f = 'F:/Maya/pengenalan pola/tugas image retrieve/image';
fileList = dir(fullfile(f,'*.jpg'));
for m = 1:2
name{m} = fileList(m).name;
axes(handles.axes(num2str(m+1)));
imshow(imread(name(m)))
end
Of course, that returns error.. Help me plzz...
Maya

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 11월 8일
The handle of the axes (or the tag of the axes) in your GUI made from GUIDE is unlikely to be handles.axes(2) or handles.axes(3).
Maybe you should try.
axes(handles.(['axes',num2str(m+1)]))
set a break point in your code, run your code line by line, check the value of those variables to find out.
  댓글 수: 2
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 9일
i'll try your code,,
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 9일
thx u so much Mr. Jiang, ur solution works! great! i'm very happy :)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2011년 11월 8일
Why are you even bothering with a loop for just two axes??? Just do something like
axes(handles.axes1);
imshow(fileList(1).name);
axes(handles.axes2);
imshow(fileList(2).name);
It even takes up fewer lines than your for loop.
  댓글 수: 1
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 9일
just in case i'll perform in large number of axes,,
thx 4 your answer,, :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by