I'm facing problem with graph and digraphs in matlab

1 次查看(过去 30 天)
Hello everyone, My question is how can we plot graphs using nodes and edges(streets in my case), while I am doing the same it keeps on showing the followingerror....can anyone show me how can I rectify the same....
  6 个评论
Stephan
Stephan 2019-2-28
Ok,
can you provide the results of this code which are in your workspace? Please save them as .mat-file and attach them. I do not have access to Mapping Toolbox and if i had it would be needed to see the .shp-files. But more important is what you have as variables in workspace.
Rama Sidhardha Yeleti
Sir, below attached is the varaibles in workspace that are generated while running that code please check once.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2019-3-1
kk = [r.coor_x_sam; r.coor_y_sam].';
sd = [ss.START_X; ss.END_X] .';
However, these are two different sizes: 2021 entries compared to 1044 entries. Neither one of them contains integers, so neither of them contains vertices indexes. Neither one of them is an adjacency matrix or mass matrix. The units appear to be incompatible: it looks to me as if coor_x_sam is degrees whereas START_X appears to be UMC, and coor_x appears to be UMC. You also are not taking into account any Y coordinates.
I think what you have is map data, not graph data.
Now, it happens to be possible to match coor_x and coor_y against START_X and START_Y, indicating that it would be possible to convert into node numbers to construct a graph; it would then be possible to associate X Y coordinates with each node when you plotted, but that can be a bit of a nuisance.
  20 个评论
Rama Sidhardha Yeleti
Sir, while applying the all-pairs-shortest-path-graph-solver it is not running and it is out with various errors can you give a try on that ?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Directed Graphs 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by