Simultaneous graph animations issue

So I'm currently attempting to animate multiple graphs on the same page using the comet() funtion, but when I run the functions together, they run one after the other,
each graph is modelled similarly but I'd like to have them all run simultaneously on the same graph. Is that possible for a comet() function?
x = a+b*cos(3*pi*t);
y = b+c*sin(3*pi*t);
plot(x,y);
comet(x,y);
hold on

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 9 日

0 投票

Try this example
h1 = animatedline('Color', 'r');
h2 = animatedline('Color', 'b');
x1 = linspace(0, 10, 100);
x2 = linspace(0, 10, 100);
y1 = sin(x1);
y2 = cos(x2);
axis([0,10,-1,1])
for k = 1:length(x1)
addpoints(h1,x1(k),y1(k));
addpoints(h2,x2(k),y2(k));
drawnow
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeAnimation についてさらに検索

質問済み:

2020 年 5 月 9 日

回答済み:

2020 年 5 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by