How can i calculate the velocity of al those rats in X and Y coordinates
Ältere Kommentare anzeigen
Hey Guys,
I have a file with time and many X and Y coordinates of 8 rats who walk through a maze, i need to calculate the X and Y velocity of al those rats separately. Can someone help me with this? (Sorry i am a matlab noob...)
Antworten (1)
Sean de Wolski
am 20 Mär. 2014
To get the data into MATLAB, use the Import Tool on the left hand side of the toolstrip or double click the file in the current folder browser.
At each step, calculate the distance walked by each rat (I'd use hypot and diff to do this) and divide by the time.
For example:
x = 0:10
y = 0:10
t = 0:10
rates = hypot(diff(x),diff(y))./diff(t)
% hypot(Difference in x difference in y) divided by difference in t
1 Kommentar
Paul
am 20 Mär. 2014
Kategorien
Mehr zu Labyrinth problems finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!