Just doing basic animation of an arrow in a unit circle sweeping from 0 to 2*pi using the Matlab provided animation sample code of playing a movie using the movie function.
I took the sample code from Matlab, commented the parts that were related to the peaks animation and replaced them with the unit circle animation that I am trying to do.
The animation is happening, but the scale is getting bigger an bigger with each frame...making the unit arrow appearing smaller.
Why is this happening? Thanks.
Record Frames and Play Movie Once
Use the getframe function in a loop to record frames of the peaks example function, then play the movie frames once.
Create a figure object h. Initialize the surface plot of the peaks function Z. Customize the figure axes.
theta = linspace(0, 2*pi, 40);
r = ones(1,length(theta));
[u, v] = pol2cart(theta, r);
ax.NextPlot = 'replaceChildren';
Preallocate a 40-element array M to store the movie frames.
M(loops) = struct('cdata',[],'colormap',[]);
For each iteration of j, capture each plot of function X as an individual frame. Store the frame in M.
Set the 'Visible' property of the figure object to 'off' to hide the surface plots while calculating X.
Set the 'Visible' property of the figure to 'on' and play the movie in M once.