Azzera filtri
Azzera filtri

Plotting A Network Diagram

17 visualizzazioni (ultimi 30 giorni)
Amritpal Kaur
Amritpal Kaur il 9 Mag 2016
Commentato: Walter Roberson il 10 Mag 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.

Risposte (2)

Walter Roberson
Walter Roberson il 9 Mag 2016
  2 Commenti
Amritpal Kaur
Amritpal Kaur il 9 Mag 2016
Modificato: Amritpal Kaur il 9 Mag 2016
This is obviously an useless link as it doesn't solve the problem.
Walter Roberson
Walter Roberson il 10 Mag 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.

Accedi per commentare.


Steven Lord
Steven Lord il 10 Mag 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.

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by