I have been having problem with identifying two maximum values' position in 3D matrix (MATLAB). Say I have matrix A
output as follows:
A(:,:,1) =
5 3 5
0 1 0
A(:,:,2) =
0 2 0
8 0 8
A(:,:,3) =
3 0 0
0 7 7
A(:,:,4) =
6 6 0
4 0 0
For the first A(:,:,1)
, I want to identify that the first row have the highest value (A=5)
. But I need the two index position, which in this case, 1
and 3
. And this is the same as the other A(:,:,:)
.
I have searched through SO but since I am bad in MATLAB, I couldn't find way to work this through.
Please do help me on this. It would be better if I don't need to use for loop to get the desired output.
5
atA(2,1,1)
? – Divakar5
is still less than8
. My aim here is to find a row for each 3D matrix with two maximum value and identify their index. – lossa row for each 3D matrix with two maximum value
? I am lost here! Write down the expected output? – Divakarshots
, just not sure which one. – Divakar