Plotting a figure from a matrix
2 ビュー (過去 30 日間)
古いコメントを表示
I have the following matrix, which describe the connection between nodes on a network. How can I plot this in Matlab?
A=[1 2; 2 3;2 4;3 5; 5 6; 6 7]
The node 1 is connected to 2, the node 2 is conncted to 3 and 4, node 3 is connected to node 5, which is conncted to 6, which is conncted to 7.
How can I plot this in matlab?
Thank you.
0 件のコメント
採用された回答
dpb
2023 年 6 月 30 日
A=[1 2; 2 3;2 4;3 5; 5 6; 6 7];
G=graph(A(:,1),A(:,2))
plot(G)
7 件のコメント
Cris LaPierre
2023 年 6 月 30 日
Node labels have shown up by default since this function was introduced (R2015b)
dpb
2023 年 6 月 30 日
I would have thought so, too. So wonder what's going on with OP if don't show up for him? Is there a property to turn them on/off?
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!