how to display a 1D cell array containing one or more images as an image?

2 ビュー (過去 30 日間)
Mohammed
Mohammed 2016 年 9 月 10 日
回答済み: Image Analyst 2016 年 9 月 10 日
I am writing a MATLAB function that takes a 1D cell array that contains one or more images as an input. i want the function to take the cell array and as output, display an image representing that array. how do i do this in matlab?
Thanks :)

回答 (1 件)

Image Analyst
Image Analyst 2016 年 9 月 10 日
Try this
function DisplayImagesFromCellArray(ca)
for k = 1 : length(ca)
thisImage = ca{k}; % Extract image from the kth cell.
imshow(thisImage); % Display the image.
drawnow; % Force it to update the screen immediately.
pause(0.4); % Wait 0.4 seconds, long enough for user to see it.
end
If you want a single line instead of 2, you could do
imshow(ca{k}); % Display the image.

Community Treasure Hunt

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

Start Hunting!

Translated by