How to animate a cosine plot using getframe
Ältere Kommentare anzeigen
Hi, I'm pretty new to Matlab and I've been playing around trying to animate a 2D cosine graph using the getframe function. Here's my code
t=0:pi/100:10;
tlength = numel(t);
for i=1:tlength
plot(cos(t));
F(:,i) = getframe;
end
movie(F);
But when I try running it it's not animated at all, just a still plot. What am I doing wrong?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Animation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!