フィルターのクリア

How to create jpg file from .mat for making video( AVI.fomat)

10 ビュー (過去 30 日間)
Tossawon Ngamnet
Tossawon Ngamnet 2018 年 5 月 21 日
コメント済み: KSSV 2018 年 5 月 22 日
I have 2000 .mat file(524*424 matrix for each .mat). Now i want to create each .mat to jpeg file to build AVI video. Could anyone guide me to do this? (i used matlab 2017 )

採用された回答

KSSV
KSSV 2018 年 5 月 21 日
files = dir('*.mat') ;
N = length(files) ;
% create the video writer with 1 fps
writerObj = VideoWriter('myVideo.avi');
writerObj.FrameRate = 10;
% open the video writer
open(writerObj);
for i = 1:N
S = load(files(i).name) ;
A = S.A ; % let A be the data stored in .mat file
imshow(A)
drawnow
% write the frames to the video
F = getframe(gcf) ;
writeVideo(writerObj, F);
end
% close the writer object
close(writerObj);
fprintf('Sucessfully generated the video\n')
  2 件のコメント
Tossawon Ngamnet
Tossawon Ngamnet 2018 年 5 月 21 日
thank you for kind reply. i have problem when i was running is Reference to non-existent field 'A'.'
please suggest about the problem.
Thank you.
KSSV
KSSV 2018 年 5 月 22 日
I referred your data as A . What variable is your data in .mat file?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by