How can I get adjacency matrix from the interconnection pairs?

2 ビュー (過去 30 日間)
Jay Vaidya
Jay Vaidya 2019 年 12 月 31 日
コメント済み: Jay Vaidya 2020 年 1 月 3 日
​I have the matrix (matrix.xlsx) as attached below. This matrix.xlsx has all interconnection between nodes and corresponding weights. I want to construct an adjacency matrix from this. I know this could be easy when we use the below code:​
Graph = digraph(matrix(:,1),matrix(:,2),matrix(:,3));
plot(Graph)
A = adjacency(Graph,'weighted');
B = full(A);
But I always get the B matrix to be SizeX^2 x SizeY^2.
Lets say SizeX = 51 and SizeY = 51 (as in this case). Then the order of the fig c matrix must be 51x51 with the data values filled by corresponding weights. But if I use the above method I get the order of fig c matrix to be 2601x2601 (=51*51x51*51). I am unable to get the below part fixed. Please suggest me some solutions. Thanks in advance. I have attached the matrix.xlsx file below.
2.JPG
  2 件のコメント
Jalaj Gambhir
Jalaj Gambhir 2020 年 1 月 3 日
Hi,
The file that you have shared is a graph with 2601 nodes. And 5000 edges. The adjacency matrix is bound to be of 2601x2601. Can you elaborate on how you'd expect the matrix in Fig c as of size 51x51
Jay Vaidya
Jay Vaidya 2020 年 1 月 3 日
Hi Mr. Gambhir,
My goal is to make the color map below:
Also, I made the new thread that for this, please let me know if you can help here.
2.JPG

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by