How to show all cell contents which is images 1 by 1 using imshow
1 次查看(过去 30 天)
显示 更早的评论
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.
![1.cell_show.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/144976/1.cell_show.jpeg)
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!