How to turn an adjacency matrix into a graph of cubes?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Steven Lord
2021-4-26
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 个评论
Steven Lord
2021-4-26
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])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete Data Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!