Program to calculate Distance between points and fixed point

1 Ansicht (letzte 30 Tage)
Yadu Bhusal
Yadu Bhusal am 5 Aug. 2021
Kommentiert: Matt J am 5 Aug. 2021
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?

Akzeptierte Antwort

Matt J
Matt J am 5 Aug. 2021
Use pdist2
distances=pdist2([A;B;C],P)
  4 Kommentare
Yadu Bhusal
Yadu Bhusal am 5 Aug. 2021
Thank you. And can angle made by A,B,C to P be calculated using these distances and these points or distances?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by