caculate euclidean distance between columm in matrix

1 回表示 (過去 30 日間)
Dung Tran Hoang
Dung Tran Hoang 2020 年 4 月 22 日
回答済み: KSSV 2020 年 4 月 22 日
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

採用された回答

KSSV
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 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by