system of ode get values at last t

3 visualizaciones (últimos 30 días)
Renee
Renee el 20 de Oct. de 2014
Comentada: Star Strider el 20 de Oct. de 2014
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!

Respuesta aceptada

Star Strider
Star Strider el 20 de Oct. de 2014
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 comentarios
Renee
Renee el 20 de Oct. de 2014
Thanks!!
Star Strider
Star Strider el 20 de Oct. de 2014
My pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by