필터 지우기
필터 지우기

For loop to display images

조회 수: 9 (최근 30일)
Catherine Jackson
Catherine Jackson 2015년 9월 8일
편집: Walter Roberson 2015년 9월 8일
So I am trying to make a for loop to display an array of images for a user to choose between two images and for the program to save the input data from the user (Left or Right), and then to go on displaying two more images to choose from. I understand that a for loop is needed for this but I don't quite know how to put it together. I have information, but it's very piecey. Any help is great because I am super new to MATLAB and I'm not communicating well with my lab adviser.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 9월 8일
편집: Walter Roberson 2015년 9월 8일
for K = 1 : size(ImagePairs,1)
subplot(1,2,1)
image(ImagePairs{K,1}};
title('Left')
subplot(1,2,2)
image(ImagePairs{K,2});
title('Right')
drawnow();
Q = input('Left (L) or Right (R)? ', 's'):
answers{K} = lower(Q);
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by