Effacer les filtres
Effacer les filtres

Plotting A Network Diagram

17 vues (au cours des 30 derniers jours)
Amritpal Kaur
Amritpal Kaur le 9 Mai 2016
Commenté : Walter Roberson le 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.

Réponses (2)

Walter Roberson
Walter Roberson le 9 Mai 2016
  2 commentaires
Amritpal Kaur
Amritpal Kaur le 9 Mai 2016
Modifié(e) : Amritpal Kaur le 9 Mai 2016
This is obviously an useless link as it doesn't solve the problem.
Walter Roberson
Walter Roberson le 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.

Connectez-vous pour commenter.


Steven Lord
Steven Lord le 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.

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by