How to calculate total distance traveled from position vs time experimental data
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Steven Brace
am 7 Jun. 2019
Bearbeitet: Steven Brace
am 7 Jun. 2019
I have some experimental data like this (position against time), how do i find the scalar value of distance moved?
This should be 10+16+16+14=56m.* fixed dumb error
Not interested in direction just magnitude of movement.
Thanks!
3 Kommentare
Akzeptierte Antwort
Alex Mcaulley
am 7 Jun. 2019
Following your image, you have a position array like:
position = [10,10,0,0,-16,-16,0,14];
Then to calculate the total distance:
distance = sum(abs(diff(position)))
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!