How to use comet function to show trajectory of two bodies simultaneously?

28 ビュー (過去 30 日間)
Ram Massas
Ram Massas 2023 年 1 月 9 日
回答済み: Walter Roberson 2023 年 1 月 19 日
Hello matlab cumunity,
I have done an expremint, in the experiment I fly 2 drones in diffrent tajectory in space.
the location of the first drone represent as vector (rx1,ry1,rz1) and the location of the second drone represent as vector (rx2,ry2,rz2).
unfortunately the function comet3 works only on one vector,so i can see the trajectory only of one drone.
for now i use the fumction plot3 and hold on ,but i want to use comet3 functtion to see the drones trajectory more clearly.
i will glad if you can suggest an idea to solve this problem.

採用された回答

Walter Roberson
Walter Roberson 2023 年 1 月 19 日
comet() is designed to build a timer, display data according to the timer schedule, then destroy the timer and then return. It is not capable of running multiple comets simultaneously.
I suggest you consider using animatedline with a limit on the number of displayed points (the tail) and loop doing addpoints and drawnow

その他の回答 (1 件)

Dongyue
Dongyue 2023 年 1 月 19 日

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by