open multiple pictures from a list with for loops
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have the following problem:
I have a huge pool of pictures of which every participant in an experiment saw a portion of. Every participant has it's indiviual StimulusList in which all pictures are listed which they saw.
My goal is to enter the StimulusList of one participant and to see all the pictures he/her saw. I don't care if they open in separate windows or if I click through them (like in a gallery) (altough I'd prefer the latter version).
I have coded the following: The code works (no errors) but it only opens one picture.
All files (StimulusLists and Pics) are stored in the same WD.
clc
clear
load VP_001_StimulusList.mat; %enter StimulusList here
StimulusList = struct2table(StimulusList);
StimulusList.num = num2str(StimulusList.num, '%03d'); %add leading zeros (in the StimulusList there are no leading
%zeros but in the file names of the pics there are, hence I added them)
StimulusList.pic = strcat(StimulusList.type, '_', StimulusList.num); %the filenames of the pics are always set up as
%following negative[or]neutral_XXX, the negative[or]neutral condition and
%the number are stored in different collumns of the StimulusList, hence I
%used strcat()
for i = height(StimulusList)
file = StimulusList{i,4};
file_cat = strcat(file, '.jpg');
file_cat = string(file_cat);
img = imread(file_cat);
figure, imshow(img);
end
%the loop works but it only opens one window and one picture
Thank you for your help!
and happy new year :)
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!