How to view images from a .mat file?

6 ビュー (過去 30 日間)
Ahmed
Ahmed 2014 年 3 月 17 日
コメント済み: Image Analyst 2014 年 3 月 17 日
I have a mat file(ballimage.mat) in which there is a folder called ballimage1 that includes 23 pictures(p1 p2 p3.... p23). How can I view these images in order as if it is a video? Thanks.

採用された回答

Image Analyst
Image Analyst 2014 年 3 月 17 日
Since you save them all as separate images with different names you'll have to extract them and show them one at a time.
% Load the structure.
s = load('ballimage.mat');
% Extract the first image and display it.
p1 = s.p1
imshow(p1);
% Extract the second image and display it.
p2 = s.p2
imshow(p2);
% Extract the third image and display it.
p3 = s.p3
imshow(p3);
and so on.
  1 件のコメント
Image Analyst
Image Analyst 2014 年 3 月 17 日
To make sure it displays, add a "drawnow" after each imshow().

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by