Plotting A Network Diagram
조회 수: 11 (최근 30일)
이전 댓글 표시
So I have certain dataset that looks like this:
Source destination time quality
192.168.2.101 192.168.2.102 0.691597938537598 0.76
192.168.2.101 192.168.2.109 0.691597938537598 0
192.168.2.101 192.168.2.106 0.691597938537598 0.64
192.168.2.101 192.168.2.103 0.691597938537598 0.7
192.168.2.101 192.168.2.107 0.691597938537598 0.95
192.168.2.101 192.168.2.110 0.691597938537598 0.5
I want to draw a network where edges are between source and destination and the edge weights are based on the value in quality.
However when ever I try to create an EdgeTable (I imported the above dataset as table named me_1, I get an error. This is my code,
EdgeTable = table([me_1.ip' me_1.neighbor'],me_1.lq,'VariableNames',{'EndNodes' 'Weight'});
What am I doing wrong? Also what would be the best way to show network topology change based on the time value of my dataset?
Thanks.
댓글 수: 0
답변 (2개)
Walter Roberson
2016년 5월 9일
댓글 수: 2
Walter Roberson
2016년 5월 10일
"I want to draw a network where edges are between source and destination and the edge weights are based on the value in quality."
And the link shows drawing a graph with the thickness of the edges proportional to the edge weight (which is something you requested in your duplicate posting)
If you need to get node numbers, then put all of the cell strings representing the IP addresses together in a single cell array and use unique() on it. Then ismember() against the unique array gives you a node number. You can use the source node numbers and destination node numbers in a graph() call.
Steven Lord
2016년 5월 10일
What is the full text of the error message you received when you tried to construct that table?
If you can't construct that table and use the digraph constructor that accepts tables, consider creating it using source and target node pairs (the s and t input arguments described on the digraph documentation page) and add weights afterwards. Then use the approach given in the "Edge Line Width Proportional to Edge Weight" example on the plot documentation page.
댓글 수: 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!