how to take the derivative for the retained value from ode45?

1 次查看(过去 30 天)
I'm using the ode45 to find the velocity, now I need to find the acceleration how can I take the derivative of the retained value.
My ode45 is:
[ts,xs]= ode45(@my_function,[0,10],[5,0])
Thanks in advance!

回答(2 个)

Walter Roberson
Walter Roberson 2013-7-31
gradient(xs(1,:), ts(:))
  6 个评论
Jan
Jan 2013-8-1
gradient uses a first order method when the spacing is not equidistant. You can use the faster method FEX: DGradient and some other equivalent tools from the FEX, which apply a 2nd order method to get more accurate results for the derivatives.

请先登录,再进行评论。


Nawal
Nawal 2013-8-1
Can I do something like
diff [ts,xs]

类别

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