Program to calculate Distance between points and fixed point

조회 수: 2 (최근 30일)
Yadu Bhusal
Yadu Bhusal 2021년 8월 5일
댓글: Matt J 2021년 8월 5일
I have three points A(000),B(111),C(222) and one fixed position P(333). I want make program to calculate the distance from A, B and C to point P using for loops. Appreciate if have some idea?

채택된 답변

Matt J
Matt J 2021년 8월 5일
Use pdist2
distances=pdist2([A;B;C],P)
  댓글 수: 4
Yadu Bhusal
Yadu Bhusal 2021년 8월 5일
Thank you. And can angle made by A,B,C to P be calculated using these distances and these points or distances?
Matt J
Matt J 2021년 8월 5일
No, they cannot.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by