Select rows by minimum values of a column considering unique values of another column

I want to select only the rows for each unique name of a column (first column) that have a minimum value in another column (sixth column). This is my data in matlab.
I want to select a row for each unique name_file that has its minimum value in Z_value_Secondcriterion.
Any idea about how to do it Matlab?

 採用された回答

Matt J
Matt J 2021 年 4 月 12 日
編集済み: Matt J 2021 年 4 月 12 日
A=Results{:,1};
B=str2double(Results{:,6});
C=(1:numel(B)).';
G=findgroups(A);
sel=splitapply(@(b,c) c(find(b==min(b),1)), B,C, G);
Selection=Results(sel,:)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

製品

リリース

R2019a

質問済み:

2021 年 4 月 12 日

編集済み:

2021 年 4 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by