Calculating efficiently the euclidean distance
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Riccardo Tronconi
le 19 Juil 2021
Commenté : Riccardo Tronconi
le 19 Juil 2021
Hi guys I would like to calculate the euclidean distance without a for loop to speed up my running time.
I have a timetable A as input with m-rows and 4 columns:
1st column: X point 1
2nd column: Y point 1
3rd column: X point 2
4th column: Y point2
Now I loop over each row of the timetable and I use norm( A(i, 1:2) - A(i, 3:4)). Of course the output should be mx1.
Is there a more efficient way to compute this operation?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!