MATLAB: Calculating distance covered from x and y coordinates

distance; distance coveredMATLAB

Hi,
I am trying to calculate the distance covered by a footballer in a ten-minute game. I have 3000 x-coordinates and 3000 y-coordinates in a 3000 by 2 matrix. Does anyone know how I can compute the distance covered?
Thank you
Ben

Best Answer

This would be my approach:
x = randi(99, 1, 100); % Create Data

y = randi(99, 1, 100); % Create Data
d = hypot(diff(x), diff(y)); % Distance Of Each Segment
d_tot = sum(d); % Total Distance