get adjacent matrix from horizontal visibility Graph code.

1 次查看(过去 30 天)
i want to get adjacency matrix from horizontal visibility graph code. i know that reshaping dvd as 1xnumel(dvd) would get adjancency matrix 12x12 but i have to run graph code for each column by using for loop columnwise on smaller data (dvd) and get a single adjacent matrix, i am trying this so that i can also run this for large data,which gives me adjancency matrix of 1048560x1048560.

回答(1 个)

SAI SRUJAN
SAI SRUJAN 2023-10-11
Hi Vedant Chauhan,
I understand that you are trying to find the adjacency matrix of a graph.
In MATLAB,you have the ability to get the adjacency matrix of a graph using "adjacency" function.You can follow the below given example to resolve the issue.
A = [0 5 3 0;0 0 1 2; 0 0 0 11; 0 0 0 0];
G = graph(A,'upper');
B = adjacency(G);
For a comprehensive understanding of the "adjacency" function in MATLAB, please refer to the provided documentation below.

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by