%将一串图片转为视频 
vidObj = VideoWriter('output','MPEG-4');
open(vidObj);
for n = 1:451
path = strcat('jpg/',num2str(n),'.jpg');
f = imread(path);
writeVideo(vidObj,f);
end
% 关闭视频文件
close(vidObj);