Mercurial > hg > ishara
annotate general/arrutils/findmd.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
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); |