How to save figure frames as gif file?
250 ビュー (過去 30 日間)
I am having a problem while saving my figure frames as a gif file. I am using this code -
for i = 1:Leng
title(['Time = ' num2str(t(i))]);
plot(px(i,:),py(i,:),'o','MarkerSize',4,'color',[1 0 0]);
F(i) = getframe(gcf);
writerObj = VideoWriter('Particle02.gif');
writerObj.FrameRate = 10;
% write the frames to the video
frame = F(i) ;
% close the writer object
Although I am saving it as '.gif' file, it is being saved as '.avi' file.
Can anyone please help? Any feedback will be much appreciated!