Plotting graphs into a movie
Show older comments
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),'-');
Answers (1)
Walter Roberson
on 6 Dec 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.
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!