[11a160]: / matlab_source / norm_adj.m

Download this file

14 lines (11 with data), 262 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
function [ W ] = norm_adj( adj )
degree = sum(adj');
W = zeros(length(adj(:,1)),length(adj(1,:)));
for i = 1:length(adj(:,1)),
for j = 1:length(adj(1,:)),
if adj(i,j) ~= 0,
W(i,j) = 1/degree(i);
end
end
end
end