Get distance between adjacent array cells
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dries van Roovert
el 14 de Nov. de 2016
Respondida: Dries van Roovert
el 16 de Nov. de 2016
Hello everyone,
I have a little problem calculating a velocity from a distance matrix. I do have the time array already.
My distance matrix looks as following:
dist=[x_coord1, y_coord1;
x_coord2, y_coord2;
....];
The coordinates are absolute, and I need the relative distance between the current coordinates and the previous one.
So, my vector should look like this:
newdist=[pdist2([x_coord2,y_coord2],[x_coord1,y_coord1]);
pdist2([x_coord3,y_coord3],[x_coord2,y_coord2])
......];
But instead pdist2 gives a vector with the distance of every possible combination of cells.
My questions(in my opinion at least):
1. Are there any functions which give me what I want immediately; or if this is not the case
2. Is there a way to decipher the pdist2 vector and get the correct values?
Thanks for reading this long post and helping :)
Kind regards, Dries van Roovert
0 comentarios
Respuesta aceptada
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!