about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/graph/neighbors.m
blob: 7275c4e0c68f8eec7cd3e413b9edfcd575a1ae9f (plain)
1
2
3
4
5
6
7
function ns = neighbors(adj_mat, i)
% NEIGHBORS Find the parents and children of a node in a graph.
% ns = neighbors(adj_mat, i)

%ns = myunion(children(adj_mat, i), parents(adj_mat, i));
ns = unique([find(adj_mat(i,:)) find(adj_mat(:,i))']);