Mercurial > hg > ishara
annotate general/arrutils/findmd.m @ 27:5de03f77dae1
Added documentation about types and revised arrow type specifications.
author | samer |
---|---|
date | Sat, 19 Jan 2013 14:22:09 +0000 |
parents | e44f49929e56 |
children |
rev | line source |
---|---|
samer@4 | 1 % findmd - Multidimensional find |
samer@4 | 2 % |
samer@4 | 3 % findmd :: [D:[[1,E]]] -> [[N,E]->natural]. |
samer@4 | 4 % |
samer@4 | 5 % Take an E dimensional array and return subscripts of nonzero |
samer@4 | 6 % elements. |
samer@4 | 7 function S=findmd(A) |
samer@4 | 8 |
samer@4 | 9 E=ndims(A); |
samer@4 | 10 [SX{1:E}]=ind2sub(size(A),find(A)); |
samer@4 | 11 S=cellcat(2,SX); |