caculate euclidean distance between columm in matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Dung Tran Hoang
am 22 Apr. 2020
Beantwortet: KSSV
am 22 Apr. 2020
i have a matrix like this
[2 -1 3 1;
-1 -3 2 3;
3 2 -3 6;
1 3 6 1]
anyone know how to caculate euclidean distance between first columm and the last columm in the matrix
0 Kommentare
Akzeptierte Antwort
KSSV
am 22 Apr. 2020
Let A be yout matrix...
C1 = A(:,1) ; C2 = A(:,end) ;
dC1 = diff(C1) ;
dC2 =diff(C2) ;
d = sqrt(dC1.^2+dC2.^2) ;
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!