system of ode get values at last t

5 次查看(过去 30 天)
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,:);

更多回答(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