필터 지우기
필터 지우기

Animate 2D line object

조회 수: 2 (최근 30일)
Javier Vicente
Javier Vicente 2015년 1월 20일
댓글: Javier Vicente 2015년 1월 20일
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.

채택된 답변

Image Analyst
Image Analyst 2015년 1월 20일
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
Javier Vicente
Javier Vicente 2015년 1월 20일
Seems useful! I'll work on it.
Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Chad Greene
Chad Greene 2015년 1월 20일
To make an avi, try the videoWriter function. To make a gif, look at this.

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by