How to convert sparse matrix to adjacency matrix ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
vignesh raju
le 10 Fév 2016
Commenté : the cyclist
le 12 Fév 2016
How do you convert sparse matrix to adjacency matrix in Matlab 2015?
2 commentaires
the cyclist
le 10 Fév 2016
I don't understand completely. A sparse matrix could be an adjacency matrix.
Can you please give a small example or two of the input/output you expect?
Réponse acceptée
the cyclist
le 11 Fév 2016
This submission on the MATLAB File Exchange says that it will convert a *.gml file to an adjacency matrix. Maybe it will work for you.
6 commentaires
the cyclist
le 12 Fév 2016
In MATLAB, curly brackets -- {} -- are not equivalent to parentheses -- (). Curly brackets are used for a special type of MATLAB object: a cell array.
Plus de réponses (1)
Walter Roberson
le 10 Fév 2016
adjacency_matrix = logical(TheSparseMatrix);
2 commentaires
Walter Roberson
le 11 Fév 2016
s = size(adjacency_matrix);
if s(1) < s(2)
adjacency_matrix(s(2),s(2)) = 0;
elseif s(1) > s(2)
adjacency_matrix(s(1),s(1)) = 0;
end
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!