Borrar filtros
Borrar filtros

Animate 2D line object

2 visualizaciones (últimos 30 días)
Javier Vicente
Javier Vicente el 20 de En. de 2015
Comentada: Javier Vicente el 20 de En. de 2015
Hi,
I'm trying to animate a line object, which should traslate sinusoidally in the vertical axis and rotate sinusoidally with respect to a point of the same line both at the same time.
Thanks in advance for your attention.
BR
Javi
Edit: Maybe I've been too brief. I'm trying to plot it in a GUI's axes. The thing is that with rotate and traslate commands I can't make it describe the movement I want, because the rotation center is moving as well (it belongs to the line). It should be inside a while (so that it moves until user pushes stop button), so I guess that inside rotate and translate should be a function, as well as for the origin or rotation center. I hope this clarifies the question.

Respuesta aceptada

Image Analyst
Image Analyst el 20 de En. de 2015
See the animatedline() function. From the help:
Description
h = animatedline creates an animated line that has no data and adds it to the current axes. Add points to the line in a loop to create a line animation. For more information, see Using animatedline Objects.
I've also attached a demo of making a movie from a plot/graph that you create.
  1 comentario
Javier Vicente
Javier Vicente el 20 de En. de 2015
Seems useful! I'll work on it.
Thanks.

Iniciar sesión para comentar.

Más respuestas (1)

Chad Greene
Chad Greene el 20 de En. de 2015
To make an avi, try the videoWriter function. To make a gif, look at this.

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by