how to find the next maximum value in column of the matrix which is different at the index of the first
Show older comments
Hi!
I have an N * M matrix, i want to find the maximum value in each column,if the index of the first max value is the same with the others,i will find the next maximum value in those columns.
SINR =
0.3170 0.1029 0.0780 0.0014 0.0303
0.0666 0.1213 0.2206 0.4729 0.0542
0.0157 0.0109 0.2463 0.2058 0.5439
0.0404 0.1542 0.1665 0.0251 0.1449
0.0448 0.0264 0.0024 0.0532 0.0341
0.1038 0.0240 0.0028 0.1512 0.0965
0.1099 0.0503 0.2834 0.0706 0.0887
0.0324 0.2983 0.0452 0.0719 0.0344
0.4190 0.4786 0.1560 0.0094 0.0996
0.0868 0.0037 0.0024 0.1878 0.1287
SINRmax =
0.4190 0.4786 0.2834 0.4729 0.5439
0.3170 0.2983 0.2463 0.2058 0.1449
0.1099 0.1542 0.2206 0.1878 0.1287
idx1 =
9 9 7 2 3
1 8 3 3 4
7 4 2 10 10
as we see the index of the max value in column 1 is the same in column 2 ,in this case i will choose the second max value (index 8) for column 2 .
the output : put only the max value of each column and all other values at zero
0 0 0 0 0
0 0 0 0.4729 0
0 0 0 0 0.5439
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0.2834 0 0
0 0.2983 0 0 0
0.4190 0 0 0 0
0 0 0 0 0
there is a function that allows me to do that?
can you help me please
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!