MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

0

How to show all cell contents which is images 1 by 1 using imshow

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.
1.cell_show.JPG
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 件のコメント

サインイン to comment.

1 件の回答

回答者: 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: i actually forgot to add
idxSubs = idxSubs + 1;
on after code line
title(caption,'FontSize', 11);
By the way what's differences between my way with yours sir. is yours faster or varian ?
thanks for your respon sir
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.
and automatically suit to other input (in my case number of cell contents).
Thank you Image Analyst !

サインイン to comment.



Translated by