degrees_und.m 435 B

12345678910111213141516171819202122
  1. function [deg] = degrees_und(CIJ)
  2. %DEGREES_UND Degree
  3. %
  4. % deg = degrees_und(CIJ);
  5. %
  6. % Node degree is the number of links connected to the node.
  7. %
  8. % Input: CIJ, undirected (binary/weighted) connection matrix
  9. %
  10. % Output: deg, node degree
  11. %
  12. % Note: Weight information is discarded.
  13. %
  14. %
  15. % Olaf Sporns, Indiana University, 2002/2006/2008
  16. % ensure CIJ is binary...
  17. CIJ = double(CIJ~=0);
  18. deg = sum(CIJ);