フィルターのクリア

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

1 回表示 (過去 30 日間)
Nawal
Nawal 2013 年 7 月 31 日
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 件のコメント
Richard Brown
Richard Brown 2013 年 8 月 1 日
I stand corrected, good to know!
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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by