Showing posts with label movie. Show all posts
Showing posts with label movie. Show all posts

Thursday, April 7, 2011

Making matlab avi Video with ordered file list


Easy way to display the month-year as string.
Which can then be used to prepare a video out of the file list.


video_obj = VideoWriter('rotation2.avi');
video_obj.FrameRate = 1;

open(video_obj)
months={'Jan','Feb','Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'};
for iyear=5: 9

year_st = num2str(iyear,'%2.2i');
for i=1:length(months)
fn=[months{i} '_' year_st '.fig'];
disp(fn)
Figtitle = strrep(fn,'_','');

set(gca,'FontSize',30);
eval(sprintf('title(''%s'',''FontSize'',[28],''FontWeight'',''bold'')',Figtitle));
pause(0.1)
F = getframe(fig);
writeVideo(video_obj,F);
pause(0.5)
end
close(video_obj);

end