I would like to create a 360-degree rotating surface using Matlab2013 (Linux 64 bit). I can create an animated gif using the code snippet below, but Matlab continues to resize the surface in some frames during the animation (for an example, see [1], frame 56-59). Any idea how I can prevent Matlab from resizing the surface?
Thanks in advance for your advice.
function createVideo( FigureHandler, filename )
grid on
set(gca,'ZTickLabel',[]);
set(gca,'YTickLabel',[]);
set(gca,'XTickLabel',[]);
for n = 1:360
view(n,66)
zoom off
drawnow
frame = getframe(FigureHandler);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
if n == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append','DelayTime',0);
end
end
end
[1]
http://postimg.org/image/prib1psq5/
Durin source
share