MATLAB: How to select the best matrix from a set of matrices and label it as ‘TEC’

matricesmatrixmatrix arraymatrix manipulation

For example, we have 5 matrices A,B,C,D,E and I have to select the best matrix based on a certain parameter and I want to label it as 'TEC'.
from a certain code i get
ResultM(:,:,1) =
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ResultM(:,:,2) =
1 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ResultM(:,:,3) =
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ResultM(:,:,4) =
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ResultM(:,:,5) =
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ResultEB(:,:,1) =
59
ResultEB(:,:,2) =
64
ResultEB(:,:,3) =
59
ResultEB(:,:,4) =
59
ResultEB(:,:,5) =
62
and I want to select the matrix with max value of ResultEB and want to label it as 'TEC'.

Best Answer

ResultEB(1,1,1) = 59 ;
ResultEB(1,1,2) = 64 ;
ResultEB(1,1,3) = 59 ;
ResultEB(1,1,4) = 59 ;
ResultEB(1,1,1) = 62 ;
[val,idx] = max(ResultEB) ;
TEC = ResultEB(:,:,idx) ;