changing pictures

조회 수: 1 (최근 30일)
James Timana
James Timana 2011년 10월 28일
답변: mengjiao fan 2015년 4월 13일
hi how can I create a gui that will show different pictures on the same axes but displaying only one at a time automatically

채택된 답변

Image Analyst
Image Analyst 2011년 10월 28일
Define "automatically." Do you mean in a for loop? See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F so you'll know how to do stuff like this:
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
for k = 1:length(jpegFiles)
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
drawnow; % Force display to update immediately.
promptMessage = sprintf('Do you want to Continue or Cancel?');
button = questdlg(promptMessage, 'Continue', 'Continue', 'Cancel', 'Continue');
if strcmpi(button, 'Cancel')
break;
end
end
  댓글 수: 1
James Timana
James Timana 2011년 10월 29일
Thanks i will put it to practice

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

추가 답변 (1개)

mengjiao fan
mengjiao fan 2015년 4월 13일
very useful. I also want to know how to make a time to control

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by