MATLAB: How to find a location of a specific value inside a matrices that is 26x7x101 of length

matrix

I have a value inside a 26x7x101 matrices and would like to find its i j k locations

Best Answer

[~,loc]=ismember(matrixName,value)
[i,j,k]=ind2sub([26,7,101],find(loc,1))
The above will find the first specified value in the matrix and return its i,j,k indices. The code would need some small modification if the value wasn't unique and you needed the indices of all occurrences of the specified value.