plotting an adjacency matrix
21 ビュー (過去 30 日間)
古いコメントを表示
How can I plot an adjacency matrix in matlab
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153328/image.png)
so it comes up like this. Using say this matrix
[1/60 7/15 7/15 1/60 1/601/60;
1/6 1/6 1/6 1/6 1/6 1/6;
19/60 19/60 1/60 1/60 19/60 1/60;
1/60 1/60 1/60 1/60 7/15 7/15;
1/60 1/60 1/60 7/15 1/60 7/15;
1/60 1/60 1/60 11/12 1/60 1/60]
0 件のコメント
回答 (3 件)
Walter Roberson
2016 年 1 月 15 日
Note that as an adjacency matrix, what you have simply defines the 6 x 6 "complete graph": non-zero values in the matrix imply an edge, but the exact value is otherwise not paid attention to.
If you want the weights represented on the graph, then you will need to say how you want the weights represented.
3 件のコメント
aqib javed
2016 年 12 月 7 日
you can use heatmap(A) as well. But imagesc(A) is the most practiced command
0 件のコメント
Steven Lord
2016 年 12 月 7 日
If you want to plot the adjacency matrix as a graph, create a graph or digraph object using your adjacency matrix then plot that object and customize as desired. See this documentation page for examples and more information.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!