Forums

No data written to file in Matlab when using writeVideo

Auteur Réponses
Carson12 Lundi 27 Mai 2019 à 13:42
Carson12Anonymous

I am attempting to create a movie file from ascii data using Matlab. I am running Matlab on Ubuntu 13.10. When I run my Matlab script (see below), the frames display correctly and the .avi video file is created at the end, but there is no data in the file mypremiercreditcard.

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);

And in Matlab I get the error:

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);

Edité par Carson12

Dadu042 Lundi 27 Mai 2019 à 16:34
Dadu042
Modérateur

Why asking this question here ?