movie from matlab plot saved in .png format

1 view (last 30 days)
swamp
swamp on 4 Dec 2015
Answered: Image Analyst on 4 Dec 2015
Hi guys,
I need to make a movie using my image matlab plot stored in .png... Is it possible?
Thank you!!! Have a nice day!

Answers (2)

Geoff Hayes
Geoff Hayes on 4 Dec 2015
swamp - consider using the videowriter object to create your movie from a series of images (your png files). You can instantiate the object as
v = VideoWriter('newfile.avi');
You can set the frame rate (frames per second) using set and open the file for writing as
set(v,'FrameRate',1);
open(v);
Now, you can load each of your images (from file) and then write to the avi (or whatever) as
writeVideo(v,myPng);
Once you have written all images to your movie file, then just close the object with
close(v);

Image Analyst
Image Analyst on 4 Dec 2015
I'm attaching two example for you so you can see how to make movies from figures or still frames/images.

Community Treasure Hunt

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

Start Hunting!