필터 지우기
필터 지우기

How to create subplot with .png images in a loop

조회 수: 3 (최근 30일)
mehtap agirsoy
mehtap agirsoy 2021년 7월 25일
댓글: Chunru 2021년 7월 27일
Hey all, I have 134 .png images for each 5 trials. I'd like to create subplot of 134x5 to observe the difference in each row of the 5 trials. To check my code I've used k=1:2 (instead of 5) and i=1:5 (instead of 134) but my code creates attached plot, deletes the .png files from i=1 and doesn't create a subplot what I want. Also I've quality problem of the plots. If you're able to help I'd be appreciate. Thanks in advance.

채택된 답변

Chunru
Chunru 2021년 7월 26일
편집: Chunru 2021년 7월 26일
Try montage in image processing toolbox for display multiple images.
a = imread('onion.png');
imageArray = repmat(a, [1 1 1 3*5]);
montage(imageArray, 'size', [3 5])
  댓글 수: 8
mehtap agirsoy
mehtap agirsoy 2021년 7월 27일
Millon thanks, I've created cell array for fileNames and finally able to create true montage but how can I adjust the size of the images? Mines are really small,
Chunru
Chunru 2021년 7월 27일
first, try size [5 134] rather than [134 5]. That can make the montage layout in a horizontal way and make size larger. You can also use size [10 67] so that every two rows corresponding to one experiment.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by