我做了一个10分的情节
10 10
248,628959661970 66,9462583977501
451,638770451973 939,398361884535
227,712826026548 18,1775336366957
804,449583613070 683,838613746355
986,104241895970 783,736480083219
29,9919502693899 534,137567882728
535,664190667238 885,359450931142
87,0772199008924 899,004898906140
990 990
第一列作为 x 坐标,另一列作为 y 坐标
导致以下情节:使用以下代码:scatter(Problem.Points(:,1),Problem.Points(:,2),'.b')
然后我还使用计算了欧几里得距离Problem.DistanceMatrix = pdist(Problem.Points);
Problem.DistanceMatrix = squareform(Problem.DistanceMatrix);
当距离大于某个值时,我将距离替换为 1*10^6。这导致下表:
然后,我想绘制对应点之间的线,最好是它们的距离,但前提是距离< 1 * 10 ^ 6。
具体来说,我想绘制线 [1,2] [1,4] [1,7] [2,4] 等。
我的问题是,这可以做到吗?怎么做?