我正在尝试使用Matlab从ascii数据创建一个电影文件。我在Ubuntu 13.10上运行Matlab。当我运行我的Matlab脚本(见下文)时,框架显示正确,最后创建.avi视频文件,但文件中没有数据。
clc
clear all
writerObj=VideoWriter('testVideo');
writerObj.FrameRate = 10;
open(writerObj);
for i=1:15000
j=i*100;
str=[num2str(j),'_Temp1.dat'];
t=importdata(str);
showaxes;
colorbar;
imagesc(t);
set(gca,'ydir','normal')
frame=getframe;
writeVideo(writerObj,frame);
% movieFrames(:,i) = frame;
end
close(writerObj);
在Matlab中我收到错误:
Warning: No video frames were written to this file.
The file may be invalid.
> In VideoWriter.VideoWriter>VideoWriter.close at 307
In VideoWriter.VideoWriter>VideoWriter.delete at 256
In videomaker at 2
Error using importdata (line 136)
Unable to open file.
Error in videomaker (line 11)
t=importdata(str);