[Input] C : undirected connectivity matrix [Output] pairs_bi : 1st and 2nd column -> two vertex points of an edge, 3rd column -> connectivity label 1 = bi, 0 = uni. [Example] pairs = [1 2 1 3] means un-directed connectivity between (1,2) and (1,3) Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function pairs = get_pairs_undir(C) 0002 % 0003 % [Input] 0004 % C : undirected connectivity matrix 0005 % [Output] 0006 % pairs_bi : 1st and 2nd column -> two vertex points of an edge, 3rd 0007 % column -> connectivity label 1 = bi, 0 = uni. 0008 % 0009 % [Example] 0010 % pairs = [1 2 0011 % 1 3] 0012 % means un-directed connectivity between (1,2) and (1,3) 0013 % 0014 % Copyright (C) 2011, ATR All Rights Reserved. 0015 % License : New BSD License(see VBMEG_LICENSE.txt) 0016 0017 C = triu(C,1); % upper diagonal components 0018 [I,J]=find(C ~= 0); 0019 pairs =[I J]; 0020