How to pick maximum value in group?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ASHA PON
am 19 Apr. 2022
Kommentiert: ASHA PON
am 22 Apr. 2022
I have created groups with repeating value in a matrix and elements in the group are matched with matrix having its probability value. Now I have to find the maximum probability value in each group.
Example:
group n =
prob 1 prob 2 prob 3 maxprob prob 5
Expected output:
group n = repeated value
maxprob
2 Kommentare
Adam Danz
am 19 Apr. 2022
Could you provide an actual example?
It sounds like you're looking for the max function.
Akzeptierte Antwort
Adam Danz
am 20 Apr. 2022
data = [0.74 0.66 0.58 0.47 0.606 0.705 0.76];
group = [6 6 5 6 5 6 6];
groupsummary(data(:),group(:),'max')
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Stair Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!