How to show all cell contents which is images 1 by 1 using imshow
조회 수: 2 (최근 30일)
이전 댓글 표시
Bachtiar Muhammad Lubis
2019년 1월 20일
댓글: Bachtiar Muhammad Lubis
2019년 1월 26일
i wrote this code a while ago
idxSubs = 0;
for col = 1 : length(num_char)
subplot(4, 7 , 1 + idxSubs);
imshow(num_char{1, col});
caption = sprintf('img ke- %d', col);
title(caption,'FontSize', 11);
end
but unfortunately the result didn't give like what i expected.
as you guys see, it showed me only an image which's the last content of cell.
i want to show all cell contents in a figure(1).
thanks before.
댓글 수: 0
채택된 답변
Image Analyst
2019년 1월 20일
Try this:
displayColumns = ceil(sqrt(length(num_char)));
for col = 1 : length(num_char)
subplot(displayColumns, displayColumns, col);
imshow(num_char{1, col});
caption = sprintf('img ke- %d', col);
title(caption,'FontSize', 11);
end
댓글 수: 3
Image Analyst
2019년 1월 21일
The biggest problem with your code was that the unneeded indSubs variable was not incremented. If it were, I think it would have worked. Other than that there's only a few minor things I'd have done differently (indenting the code, better variable names, etc.) so they're largely the same.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!