How to pick maximum value in group?
23 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Adam Danz
2022 年 4 月 19 日
Could you provide an actual example?
It sounds like you're looking for the max function.
採用された回答
Adam Danz
2022 年 4 月 20 日
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')
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!