Need play/pause buttons for my animation!
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have recently and successfully implemented an animation where I have the x and y axes representing the literal layout of the sensors in the ground. Then, the z axis is the acceleration reading for each sensor at the corresponding (x,y) point. I plotted it using surf/bar3. I made it an animation by using a for loop that updates the z values of each sensor, then replots the figure and I use M(i) = getframe with each iteration of the loop to update the movie.
Now, where this animation falls short is the lack of play/pause/stop buttons. This is incredibly essential because the whole reason I am constructing this animation tool is to be able to provide a quick and easy way to visualize the data we are collecting as a sort of sanity check, and I've been told that being able to pause and resume at will is pretty essential to this whole animation.
So far, the only way I've found that you can incorporate these play/pause/stop/ff/rewind buttons in Matlab in your figure is through the implay function for image sequences/AVI files. http://www.mathworks.com/help/toolbox/images/ref/implay.html Unfortunately, converting each of my generated figures for each unit of time to a jpeg would use up way too much space considering the ridiculous amounts of jpegs that would have to be generated.
BOTTOMLINE: Does anyone know of any ways i can incorporate play/pause features into my animation besides the implay function?
Thanks in advance all.
0 comentarios
Respuestas (2)
Walter Roberson
el 18 de Jul. de 2011
Please see my previous answer to you in http://www.mathworks.com/matlabcentral/answers/11667-animation-troubles
Patrick Kalita
el 20 de Jul. de 2011
I'm not quite sure I understand your objection to using implay. If you have a movie structure generated with getframe, you can pass that directly to implay -- no converting necessary. For example:
% Generate the movie structure
figure('Renderer', 'zbuffer')
Z = peaks; surf(Z);
axis tight
set(gca,'NextPlot','replacechildren');
F(20) = struct('cdata',[],'colormap',[]);
for j = 1:20
surf(.01+sin(2*pi*j/20)*Z,Z)
F(j) = getframe;
end
% Play with IMPLAY
implay(F)
Ver también
Categorías
Más información sobre Animation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!