Plotting graphs into a movie

Given the following code, there is a variable "I" that is set to 0. How can I increase "I" to 2 while making it a movie. Example: Increasing "I" at 0.01 increments and as "I" increases the graph will change and that change can be shown as a movie.
function dot=fitz(t,v);
dot=zeros(2,1);
I=0;
dot(2)=0.08*(v(1)+0.7-0.8*v(2));
dot(1)=v(1)-(v(1)^3)/3-v(2)+I;
[t,v]=ode45('fitz',[0 200],[0,0]);
plot(v(:,1),v(:,2),'-');

Réponses (1)

Walter Roberson
Walter Roberson le 6 Déc 2013

0 votes

After the plot(), add a short pause(), and then getframe(). If you aren't generating a lot of frames, then store them all and use videowriter afterwards. But if needed for storage, use videowriter as you go.

1 commentaire

Yeetesh
Yeetesh le 6 Déc 2013
How would I increase variable "I" so I can make different plots? I would like the program to increase I by 0.01 and plot every graph one after another on the same window like a movie. I get the pause and getframe part, but what to I put into the program to increase "I" while the program runs?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Animation dans Centre d'aide et File Exchange

Question posée :

le 6 Déc 2013

Commenté :

le 6 Déc 2013

Community Treasure Hunt

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

Start Hunting!

Translated by