How can I animate a parabolic function?

%Here is my code to plot -x^2 slowly like the comet function:
x = linspace(0,4*pi,100);
for a = linspace(-10,10,200)
y = -(x+a).^2;
plot(x,y,'o')
drawnow;
pause(1/40);
end
So how can I edit it to look like the comet function smoothly?

Respuestas (1)

Star Strider
Star Strider el 5 de Jul. de 2016

0 votos

Plotting it in real time will probably not result in the smoothness you want.
I would experiment with im2frame and movie.

Categorías

Más información sobre Animation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 5 de Jul. de 2016

Respondida:

el 5 de Jul. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by