FormationControlSimulation/SOURCE/networks-toolbox/numNodes.m

9 lines
269 B
Matlab
Raw Normal View History

2019-06-17 14:31:50 +07:00
% Return the number of nodes, given an adjacency list, or adjacency matrix
% INPUTs: adjacency list: {i:j_1,j_2 ..} or adjacency matrix, ex: [0 1; 1 0]
% OUTPUTs: number of nodes, integer
%
% GB: last update Sep 19, 2012
function n = numNodes(adjL)
n = length(adjL);