use of find command for 3d array
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Adam
am 15 Mär. 2017
doc ind2sub
Use the standard form of find that returns linear indices and convert them using ind2sub to 3d.
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!