caculate euclidean distance between columm in matrix
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2020-4-22
Let A be yout matrix...
C1 = A(:,1) ; C2 = A(:,end) ;
dC1 = diff(C1) ;
dC2 =diff(C2) ;
d = sqrt(dC1.^2+dC2.^2) ;
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!