|
rodrikas <carballo.rodrigo@gmail.com> wrote in message <1234565711.48094.1271853648099.JavaMail.root@gallium.mathforum.org>...
> hi,
>
> I am trying to obtain the position of the values higher than a threshold (in terms of indexes (i,j,k))within a 3D matrix.
>
> In a matrix 2D I use the command "[row,cols]=find..." but I don´t know if this can be done in a 3D matrix.
>
> Any help is appreciated. Thanks in advance
>
> Rodrigo
Take a look at linear indices and IND2SUB
M = ceil(10*rand(5,4,3)) ;
idx = find(M > 5) % linear indices
[ri,ci,pi] = ind2sub(size(M), idx) sub indices
hth
Jos
|