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

1 comment:

how to convert dvd to itunes mac said...

I really appreciate this information and will try all the things you put out to try.