0001 0002 function [plotPoints] = plotShortestPath(nodeList, positionRoad_no, node1Node2Road_noCost) 0003 0004 roadList = []; 0005 for i = 1:length(nodeList(:,1)) 0006 idx_row = find(node1Node2Road_noCost(:,1) == nodeList(i,1)); 0007 for j = 1:length(idx_row) 0008 if node1Node2Road_noCost(idx_row(j),2) == nodeList(i,2) 0009 for k = 1:length(nodeList(:,1)) 0010 idx_row_sec = find(node1Node2Road_noCost(:,3) == nodeList(k,3)); 0011 for h = 1:length(idx_row_sec) 0012 if node1Node2Road_noCost(idx_row_sec(h),4) == nodeList(i,4) 0013 roadList = [roadList; node1Node2Road_noCost(idx_row_sec(h),5)]; 0014 end; 0015 end; 0016 end; 0017 end; 0018 end; 0019 end; 0020 0021 0022 0023 plotPoints = []; 0024 for i = 1:length(roadList) 0025 idx_row = 0; 0026 idx_row = find(positionRoad_no(:,4) == roadList(i)); 0027 if idx_row > 0 0028 plotPoints = [plotPoints; positionRoad_no(idx_row,1:2)]; 0029 end 0030 end;