MATLAB: Make video to combine two png series from different file folder

make video

Hello,
i would like to combine two png series from different file folder and make video
for example: below I attached screenshot of the png folders of pressure and velocity. I would like to make a video to combine pressure and velocity.
thank you in advance
Yijun

Best Answer

  • How about the following solution?
    s = dir('*.png');
    v = VideoWriter('output.avi');
    open(v);
    for kk = 1:numel(s)
    filePath = fullfile(s(kk).folder,s(kk).name);
    I = imread(filePath);
    writeVideo(v,I);
    end
    close(v);