get_network_from_adjacency.m 180 Bytes
Newer Older
Raghvendra Mall's avatar
Raghvendra Mall committed
1 2 3 4 5 6 7
function [network,Nrows] = get_network_from_adjacency(A)

[i,j,w] = find(A);
network = [[i,j,w];[j,i,w]];
network = unique(network,'rows');
Nrows = size(network,1);
clear A i  j w;