Hello everyone, my Name is Johanna and I am from Germany, so please excuse my English. I am new to Matlab(R2016a) and not really experienced using it. Right now all I can rely on is the MathWorks Help site. I am currently working on a navigation solution with a fairly simple weighted directed graph, consisting of 6 nodes and 12 edges. I used the digraph function to create the graph and weighted the edges by the distances of the connected nodes. I also "attributed" the edges with attributes like Radius and Slope. So using the shortestpath function, I get a path containing the nodes. I tried a few thing like idxOut to get the edges, which build the path, but I do now know how to get the path in a form to automatically work with the idxout function. E.g. the path is [1 2 4 6] and the idxout would be idxout=findedge(G,[1 2 4], [2 4 6]. And what I want is an output not only of the nodes, but the edges you have to drive by and their attributes. I searched the help site but couldn't really find anything. Your help is much appreciated. If there is anything else you need to know about my (I guess pretty easy for you guys) problem, please let me know. Thank you. Johanna
MATLAB: Is there a way when using shortestpath to not only get the sequence of the nodes but also the edges between those nodes as output
shortestpath
Best Answer