Find max value with multiple conditions
古いコメントを表示
How can I find max value with 2 or more conditions (such as maxifs in excel).
Thanks before
6 件のコメント
darova
2020 年 1 月 15 日
You should attach more details, example
Mohammad Sami
2020 年 1 月 16 日
If your data is table, create a grouping variable in your data. Then use the function groupsummary.
Anita Fitriani
2020 年 1 月 16 日
Anita Fitriani
2020 年 1 月 16 日
Andrei Bobrov
2020 年 1 月 16 日
Please attach small part of your excel-file or data table as MATLAB variable - 'table' in mat -file.
Anita Fitriani
2020 年 1 月 16 日
採用された回答
その他の回答 (1 件)
Use logic statements for each criterion. Use logical "AND" (&) to see which elements meet all criteria. Find the max of those values.
Air Code (untested):
idxC1 = (matrix > criterion1);
idxC2 = (matrix < criterion2);
...
idxOverall = idxC1 & idxC2 & ... & idxCn;
MaxVal = max(matrix(idxOverall));
カテゴリ
ヘルプ センター および File Exchange で Data Type Identification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
