Effacer les filtres
Effacer les filtres

How can I get my figure window to pop up with the animation playing when I execute the code?

12 vues (au cours des 30 derniers jours)
Also, for some reason whenever I add to the code and then re-execute to test how it's running, it saves it from where it left off, as opposed to starting from the over from the beginning. Sorry, I'm kind of new to this. Any help would be appreciated.
N = 1000;
t = linspace(0,100,N);
x = t.*sin(t);
y = t.*cos(t);
curve = animatedline('Color','g');
grid on;
for i = 1:length(x)
addpoints(curve,x(i),y(i));
drawnow
pause(0.001)
end
  2 commentaires
Ameer Hamza
Ameer Hamza le 9 Oct 2020
Can you explain what do you mean by pop up?
Austin Shipley
Austin Shipley le 9 Oct 2020
I actually figured out the issue. I was in live script, as opposed to editor. facepalm

Connectez-vous pour commenter.

Réponse acceptée

Rik
Rik le 9 Oct 2020
You probably mean you want to make the figure the current figure and bring it to the foreground. If so:
figure(1)
cla;%if you want to clear the axes content

Plus de réponses (0)

Catégories

En savoir plus sur Animation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by