Moving Plot Around Curve Point

1 Ansicht (letzte 30 Tage)
Ragini Ravichandren
Ragini Ravichandren am 7 Okt. 2019
Kommentiert: M S Zobaer am 14 Mär. 2022
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 Kommentar
M S Zobaer
M S Zobaer am 14 Mär. 2022
hi, how to get " Symbolic Math Toolbox" for free? thanks

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Turlough Hughes
Turlough Hughes am 7 Okt. 2019
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 Kommentar
Ragini Ravichandren
Ragini Ravichandren am 8 Okt. 2019
Thank you! It works now, although the dot moves really slow.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by