system of ode get values at last t

조회 수: 4 (최근 30일)
Renee
Renee 2014년 10월 20일
댓글: Star Strider 2014년 10월 20일
I have a system of 15 odes and am solving them with ode15s. I want to display and use the values at the last t of each ode (use for initial conditions). Is there some way to do this? Im not sure how to be able to tell how many time points ode15s evaluates at. Thanks!

채택된 답변

Star Strider
Star Strider 2014년 10월 20일
To get the last values of the ‘t’ vector and ‘y’ matrix, use ‘end’ to define them:
t_final = t(end);
y_final = y(end,:);
  댓글 수: 2
Renee
Renee 2014년 10월 20일
Thanks!!
Star Strider
Star Strider 2014년 10월 20일
My pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by