How to turn an adjacency matrix into a graph of cubes?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Wolfgang McCormack
le 26 Avr 2021
Commenté : Steven Lord
le 26 Avr 2021
Hi all,
How can I turn the adjacency matrix into a graph of cubes like this? Also, I create my adjacency matrixes in Excel, do you have any suggestion for making them in Matlab when there are too many variables?
https://en.wikipedia.org/wiki/File:Symmetric_group_4;_Cayley_graph_1,5,21_(adjacency_matrix).svg
Thanks
0 commentaires
Réponse acceptée
Steven Lord
le 26 Avr 2021
You just want to visualize the pattern? Call spy on your adjacency matrix. Alternately if you need color coding see scatter, pcolor, imagesc, etc.
2 commentaires
Steven Lord
le 26 Avr 2021
A = sprand(10, 10, 0.2);
[r, c] = find(A);
scatter(c, r, 20, 's', 'filled');
grid on
set(gca, 'YDir', 'reverse')
axis([1 10 1 10])
figure
spy(A)
grid on
axis([1 10 1 10])
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!