how to take the derivative for the retained value from ode45?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Walter Roberson
am 31 Jul. 2013
gradient(xs(1,:), ts(:))
6 Kommentare
Jan
am 1 Aug. 2013
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.
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!