Integration and derivation of series of discrete points
3 views (last 30 days)
Show older comments
Hello, I have Accelaration and displacement data in terms of 1500 discrete points. I want to get velocity data in terms of discrete points from both. So How Do I integrate and differentiate the datas respectively to get velocity? I do not need accumulated velocity at the end..what I need is series of points of velocity.
0 Comments
Accepted Answer
Andrew Newell
on 27 Apr 2011
The answer depends on whether your points are regularly spaced. Let's suppose they are, at intervals dx. Note that if u is a vector of displacements at positions x, then
dudx = diff(u)/dx
gives you an estimate of the derivative at the midpoint of each interval (e.g., the first one is at (x(1)+x(2))/2). To get a good estimate of the derivative at the points x, you need a formula like
u = u(:)'; % to make sure u is a row vector
dudx = [2*(u(2)-u(1)) u(3:end)-u(1:end-2) 2*(u(end)-u(end-1))]/dx/2
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!