如何在使用坐标上找到最短路径 - Matlab

时间:2012-04-24 04:49:54

标签: matlab map plot shortest-path

我目前正在研究人行道的地图路线系统。我找到了各种坐标并将其保存在excel上。并绘制了路径的结果,如下图所示。

enter image description here

被修改 我已经阅读了http://blogs.mathworks.com/steve/2011/12/13/exploring-shortest-paths-part-5/并绘制了我想要的点数。但我一直坚持生成最短的路径。以下示例; enter image description here

我的代码是:

M = xlsread('YCKMap.xlsx');
waypoints =[M(:,2), M(:,3)];
[lttrk,lntrk] = track('rh',waypoints,'degrees');
figure(),geoshow(lttrk,lntrk,'DisplayType','line', 'color','r');

% Place Marker
r1 = 1.382199;
c1 = 103.840638;

r2 = 1.379667;
c2 = 103.841963;

hold on
plot(c1, r1, 'g*', 'MarkerSize', 10)
plot(c2, r2, 'g*', 'MarkerSize', 10)
hold off

1 个答案:

答案 0 :(得分:2)

我认为这个http://blogs.mathworks.com/steve/2011/12/13/exploring-shortest-paths-part-5/(以及该系列的其余部分)将是一本有趣的读物。然而,有很多方法可以做到这一点..