Make a point move straight up and down
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I would like to know how to plot a point and just make it go up, down, and back to the starting point. I was thinking about making a list of y values but was not sure if there was a simpler way.
Thanks
0 件のコメント
回答 (2 件)
Sulaymon Eshkabilov
2020 年 8 月 15 日
Hi,
A simple motion or animation tool with plot tools is drawnow that can be employed in your task, e.g.:
2 件のコメント
Sulaymon Eshkabilov
2020 年 8 月 15 日
Hi,
If I've understood your question correctly, you'd like to get a up and down motion of a point x, y(i). Then here is one of the possible animated plots with drawnow:
for ii=1:numel(x) %loop
plot(x,y, '--', px, y(ii),'o', 'markerfacecolor', 'y'); %circle point
hold off
drawnow
end
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!