(adsbygoogle = window.adsbygoogle || []).push({}); 2-Animated graphs on one figure HELP!!!

I want to plot 2 animated graphs on the same figure (y=sin(x) and y=cos(x)). I wrote this code

x=linspace(0,10,10000);

y1=sin(x);

y2=cos(x);

comet(x,y1);

hold on

comet

hold off

I want that the "comet head" of those two function start at the same time but in the above code i wrote, Only after matlab finish my first graph, will it start to plot the second graph. So, can anybody help me to plot those 2 animated graphs starting at the same time on the same figure.

Thank you very much.

My email : nguyentiennhat85@yahoo.com

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# 2-Animated graphs on one figure HELP

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**