how to take the derivative for the retained value from ode45?
5 ビュー (過去 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!
0 件のコメント
回答 (2 件)
Walter Roberson
2013 年 7 月 31 日
gradient(xs(1,:), ts(:))
6 件のコメント
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.
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!