Matlab Function find sum of Euclidean distances from a given 2-D point
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Sudhakar Shinde
2020년 10월 27일
Use docsearch 'Euclidean'.
Use norm to calculate the distance between the points(a & b ).
%Example:
d = norm(b-a)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!