Computing Euclidean distance between 2 points
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Elysi Cochin
am 3 Mai 2022
Bearbeitet: Bruno Luong
am 3 Mai 2022
I found a code computing Euclidean distance as
diff = q - p;
dist = sqrt(diff * diff');
is there any difference from the standard Euclidean distance formula, why transpose is taken?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Bruno Luong
am 3 Mai 2022
Bearbeitet: Bruno Luong
am 3 Mai 2022
For a row vector d
% sum(d.^2)
is equal to
% d*d'
Example
d=randi(10,1,3)
sum(d.^2)
d*d'
0 Kommentare
Siehe auch
Kategorien
Mehr zu Smoothing 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!