Plotting A Network Diagram

20 Ansichten (letzte 30 Tage)
Amritpal Kaur
Amritpal Kaur am 9 Mai 2016
Kommentiert: Walter Roberson am 10 Mai 2016
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.

Antworten (2)

Walter Roberson
Walter Roberson am 9 Mai 2016
  2 Kommentare
Amritpal Kaur
Amritpal Kaur am 9 Mai 2016
Bearbeitet: Amritpal Kaur am 9 Mai 2016
This is obviously an useless link as it doesn't solve the problem.
Walter Roberson
Walter Roberson am 10 Mai 2016
"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.

Melden Sie sich an, um zu kommentieren.


Steven Lord
Steven Lord am 10 Mai 2016
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.

Kategorien

Mehr zu Graph and Network Algorithms finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by