From: Oriane Le Pocher on
Hello !

I'm a beginner with matlab and I want to record a movie from matlab. I've tried with the following code but then when I want to replay the movie with the instruction movie(A), I have the error message : "Movi contains uninitialized frames". I don't know why. Can you help me please ?



load data.mat

stepsize = max(round(length(t)/200),1);

for i=1:stepsize:length(t)
l = zeros(3,3);
th = zeros(3,2);
l(:,2) = r1(:,i);
l(:,3) = r2(:,i);
th(:,2) = r3(:,i);

plot3(l(1,:),l(2,:),l(3,:),'o-',th(1,:),th(2,:),th(3,:),'o-');
grid on;
set(gca,'XLim',[-0.2 0.2]);
set(gca,'YLim',[-0.2 0.2]);
set(gca,'ZLim',[-0.2 0.2]);

if(i<length(t))
pause(t(i+1)-t(i));
end

A(i)=getframe;

end

save filename.mat A