SOM Toolbox Online documentation http://www.cis.hut.fi/projects/somtoolbox/

som_sub2ind

inds = som_sub2ind(msize,Subs)

SOM_SUB2IND Linear index from map grid subscripts.

 ind = som_sub2ind(msize,Subs)

  ind = som_sub2ind([10 15],[4 5]);
  ind = som_sub2ind(sMap,[4 5]);
  ind = som_sub2ind(sMap.msize,[4 5]);
  inds = som_sub2ind([10 15],[4 5; 3 2; 1 10]);

  Input and output arguments: 
   msize  (struct) map or topology struct
          (vector) size 1 x m, specifies the map grid size
   Subs   (matrix) size n x m, the subscripts of n vectors

   inds   (vector) size n x 1, corresponding linear indeces

 See also SOM_IND2SUB.



[ SOM Toolbox online doc ]