Calculation velocity and acceleration from X and Y coordinates
Show older comments
Hi, I am trying to calculate the velocity and acceleration of a football player in a 8-minute game. I have computed XY from GPS so I have distances by a 2 matrix (9256x2). I have computed distance with hypot. I have the t (9256x1) variable as well which goes like this [0; 0,05; 0,10; 0,16; 0,21; 0,26; 0,31; 0,36; 0,41; 0,47; 0,52; 0,57; 0,62; 0,67; 0,73; 0,78; 0,83; 0,88; 0,93; 0,99;] and so on.
What I do by now is the following:
% t - tiempo; d - distance between each XY point (obtained from hypotenus)
tdiff = diff(t)
% vel - velocity
vel = d(2:end)./tdiff
figure(1)
plot (t(2:end), vel)
% ac - acceleration
veldiff = diff(vel)
ac = veldiff./tdiff(2:end)
figure (2)
plot (t(3:end), ac)
Velocities seems to be correct, but acceleration data has no sense. Any suggestion? Where do I fail?
Thanks in advance
Daniel.
Accepted Answer
More Answers (0)
Categories
Find more on Automated Driving Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!