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),'-');

답변 (1개)

Walter Roberson
Walter Roberson 2013년 12월 6일

0 개 추천

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

Yeetesh
Yeetesh 2013년 12월 6일
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?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Animation에 대해 자세히 알아보기

태그

질문:

2013년 12월 6일

댓글:

2013년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by