필터 지우기
필터 지우기

How to Plot the stepsize

조회 수: 6 (최근 30일)
Kim O
Kim O 2012년 9월 14일
Hello,
I have an ODE System and I want to solve it with ode45(). Now ode45() has a dynamical step size. BUT how can I plot the stepsize within my time intervall? I want to see in which time my step size increases or decreases.
Thank you very much for your help.

채택된 답변

Star Strider
Star Strider 2012년 9월 14일
The ODE solvers return a [N x 2] matrix [t x]. To get an idea of how your step size changes, I suggest:
x = 0:length(t)-1;
stepsize = diff([0; t]);
plot(x, stepsize)
grid
Alternatively to plot stepsize as a function of the integration times:
plot(t, stepsize)
grid
Is this what you want to do?
  댓글 수: 2
Kim O
Kim O 2012년 9월 14일
yes thank you very much Star Strider 1 :)
Star Strider
Star Strider 2012년 9월 14일
It is my pleasure to help! I'm glad it worked the way you wanted it to.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by