How to select the best matrix from a set of matrices and label it as 'TEC' ?

1 view (last 30 days)
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'.

Accepted Answer

KSSV
KSSV on 28 Nov 2016
Edited: KSSV on 28 Nov 2016
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) ;

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox 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!