Matlab Function find sum of Euclidean distances from a given 2-D point

4 ビュー (過去 30 日間)
Liam Bouchereau
Liam Bouchereau 2020 年 10 月 27 日
回答済み: Sudhakar Shinde 2020 年 10 月 27 日
Can someone help me with the following question?
Create a Matlab function to find the sum of straight-line (Euclidean) distances from a given 2-D point x to the set S of k other 2-D points.
For example:
Test
x=[2 4];
S=[2 6; 2 -1; 3 3];
  2 件のコメント
KSSV
KSSV 2020 年 10 月 27 日
What have you attempted for this simple question?
Liam Bouchereau
Liam Bouchereau 2020 年 10 月 27 日
I have no idea how to attempt

サインインしてコメントする。

回答 (1 件)

Sudhakar Shinde
Sudhakar Shinde 2020 年 10 月 27 日
Use docsearch 'Euclidean'.
Use norm to calculate the distance between the points(a & b ).
%Example:
d = norm(b-a)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by