how to take the derivative for the retained value from ode45?
조회 수: 8 (최근 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!