plotting points in 3D using distances between them

2 次查看(过去 30 天)
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 个评论
KSSV
KSSV 2018-5-16
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 2018-5-16
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by