How can i calculate the velocity of al those rats in X and Y coordinates
Mostrar comentarios más antiguos
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...)
Respuestas (1)
Sean de Wolski
el 20 de Mzo. de 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 comentario
Paul
el 20 de Mzo. de 2014
Categorías
Más información sobre Labyrinth problems en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!