Find Max for Every Category
Show older comments
I have a 30 x 2 matrix. Column 1 has integers between 1 and 10 with each integer appearing at least once. Column 2 has random numbers between 1 and 1000. I want a 10X2 matrix where column 2 shows the max value from all rows that has the same integer in column 1
e.g. A = [1 12; 1 16; 2 5; 2 13; 3 9; 3 19; 3 50]
I want B = [1 16;2 13; 3 50]
Help much appreciated.
Thanks
Accepted Answer
More Answers (1)
Categories
Find more on Logical 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!