I have a three-dimensional array, and I’d like to be able to find a specific value and get the three coordinates.
For example, if I have:
A = [2 4 6; 8 10 12]
A(:,:,2) = [5 7 9; 11 13 15]
and I want to find where 7 is, I’d like to get the coordinates i = 1 j = 2 k = 2
I’ve tried variations of find(A == 7), but I haven’t got anywhere yet.
Thanks!
The function you seek is
ind2sub: