Moving Plot Around Curve Point

조회 수: 1 (최근 30일)
Ragini Ravichandren
Ragini Ravichandren 2019년 10월 7일
댓글: M S Zobaer 2022년 3월 14일
Could someone please explain how to make an animation of a moving plot point, that travels around a curve? I used the following commands:
t=6
syms t;
x(t)=sin(3*t^2)*(12*t+(10*13^(1/2))/13)
y(t)=cos(2*t^2)*(8*t+(30*17^(1/2))/17)
z(t)=t*(4*17^(1/2)*t+15)
figure(1);
fplot3(x(t), y(t), z(t), [0, 6]);
pts= linspace(0, 6, 100);
for k=1:length(pts)
fplot3(x(t), y(t), z(t), [0,6], '-k', 'LineWidth', 2);
hold on;
plot3(x(pts(k)), y(pts(k)), z(pts(k)),'r,', 'MarkerSize', 30);
hold off;
M(k)=getframe;
end
movie(M)
however no curve, nor point is formes, and no animation played.
  댓글 수: 1
M S Zobaer
M S Zobaer 2022년 3월 14일
hi, how to get " Symbolic Math Toolbox" for free? thanks

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

채택된 답변

Turlough Hughes
Turlough Hughes 2019년 10월 7일
Seems like just a syntax error. Modify the following line and see:
plot3(x(pts(k)), y(pts(k)), z(pts(k)),'or', 'MarkerSize', 5,'MarkerFaceColor','red');
  댓글 수: 1
Ragini Ravichandren
Ragini Ravichandren 2019년 10월 8일
Thank you! It works now, although the dot moves really slow.

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

추가 답변 (0개)

카테고리

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