Generating a random symmetric matrix
Afficher commentaires plus anciens
I am trying to generate a random symmetric matrix consisting of 1s and 0s (adjacency matrix)
I have the following;
A = randi(2,N,N) - 1 % Generates a random nxn matrix with values 0 or 1 (Adjacency Matrix)
However this produces a random adjacency matrix which is not symmetric.
How can I change this code to make the matrix symmetric?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!