standard euclidean distance, matlab
2 ビュー (過去 30 日間)
古いコメントを表示
Helllo
I need help with standard euclidean distance, knew would someone help with matlab code ?
I can not use, matlab function, pdist, pdist2.
I need standard euclidean distance between two vectors.
Thanks.
0 件のコメント
回答 (1 件)
Walter Roberson
2014 年 2 月 5 日
sqrt(sum((v1 - v2).^2))
6 件のコメント
Walter Roberson
2014 年 2 月 6 日
sqrt(sum((A1 ./ repmat(nanstd(A1), size(A1,1), 1) - A2 ./ repmat(nanstd(A2), size(A2,1), 1)).^2, 2))
This would be for taking the distance for the rows of A1 to the corresponding rows of A2.
I am thinking that possibly it should be different, like this:
sqrt(sum(((A1-A2) ./ repmat( nanstd([A1;A2]), size(A1,1), 1)).^2,2))
参考
カテゴリ
Help Center および File Exchange で Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!