use of find command for 3d array
Show older comments
How to use find command for a 3d array
eg. A = rand(5,5,3)
I want to get i,j,k location of the array A for value [0.5 ,0.2,0.3]
psuedo code
[i,j,k] = find(A(:,:,1) == .5 & A(:,:,2)== 0.2 & A(:,:,3) ==0.3)
but this is not working any help is highly appreciated
Accepted Answer
More Answers (1)
Adam
on 15 Mar 2017
doc ind2sub
Use the standard form of find that returns linear indices and convert them using ind2sub to 3d.
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!