plotting points in 3D using distances between them

3 Ansichten (letzte 30 Tage)
Ahilya Sawh
Ahilya Sawh am 15 Mai 2018
Kommentiert: Ahilya Sawh am 16 Mai 2018
Hello, I have a matrix of distances between 10 points. i.e. distance between point 1 and all others, distance between point 2 and all others, etc. Is there a way to plot the positions of these points in a 3D graph based on the distance information? Thank you for your help!
  2 Kommentare
KSSV
KSSV am 16 Mai 2018
Yes there are multiple options to plot. What exactly you expecting? Any pictorial example? If you want to show as points you can use plot3 and scatter.
Ahilya Sawh
Ahilya Sawh am 16 Mai 2018
Hello, Thank you for your reply, either plot3 or scatter would be great, but I am at a loss of how to use the matrix of distances as the input instead of x,y,z coordinates. For example, here is a sample 5x5 matrix of the distances between 5 points:
0.0 1.1 1.2 1.3 1.4
1.1 0.0 1.2 1.3 1.3
1.2 1.2 0.0 1.1 1.1
1.3 1.3 1.1 0.0 1.0
1.4 1.3 1.1 1.0 0.0
Row 1 is the distances between point 1 and points 2, 3, 4, 5. The diagonal values are zero since each is the distance between a point and itself. Could you please advise me on how to input this into plot3 or scatter to create a 3D plot?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by