Integration and derivation of series of discrete points

3 views (last 30 days)
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.

Accepted Answer

Andrew Newell
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
(a central difference formula except at the end points).

More Answers (1)

Arnaud Miege
Arnaud Miege on 27 Apr 2011
See for example diff and trapz. More options in the documentation under derivatives and integrals.
HTH,
Arnaud

Community Treasure Hunt

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

Start Hunting!