A moving point plot in MATLAB figure with animation.
古いコメントを表示
My program calculates position of a point on Z plane as (X,Y). I need to plot (X,Y) in Z-plane with a moving point showing location of point over the time in a single MATLAB figure. Please help.
採用された回答
その他の回答 (3 件)
Image Analyst
2013 年 7 月 24 日
4 投票
Use the comet() function. It does exactly that.
4 件のコメント
Aakash
2013 年 7 月 25 日
Wei-jiunn Jang
2016 年 3 月 30 日
Beautiful solution!
reema shrestha
2017 年 10 月 7 日
編集済み: reema shrestha
2017 年 10 月 7 日
I exactly want to do the same thing in projectile motion simulation. Instead of using comet to trace the path as well,I want to create a ball and make it follow the trajectory without drawing the trajectory,just the ball moving. Can you suggest me any?
Image Analyst
2017 年 10 月 7 日
You can perhaps just use plot() with a big dot marker over and over:
for k = 1 : whatever
x = ......
y = ......
plot(x, y, 'r.', 'MarkerSize', 30);
end
Mohamadreza Khashei
2021 年 11 月 3 日
0 投票
for k = 1 : whatever x = ...... y = ...... plot(x, y, 'r.', 'MarkerSize', 30); end
Muhammad Hadyan Utoro
2022 年 9 月 29 日
移動済み: Image Analyst
2022 年 9 月 29 日
0 投票
x = [0:0.01:2*pi];
for i = 1:length(x)
y = sin(x);
figure(1)
plot(x,y,'-o','MarkerIndices',1+i)
hold off
pause(0.005)
end
カテゴリ
ヘルプ センター および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!