フィルターのクリア

Finding maximum value between specific columns for each row

7 ビュー (過去 30 日間)
HYZ
HYZ 2020 年 2 月 5 日
回答済み: KSSV 2020 年 2 月 5 日
Hi, May I ask about Finding maximum value between specific columns for each row?
Let's say I have A = [1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20]. I would like to find maximum value for 2nd and 3rd colum for each row.
I should get B = [3; 8; 13; 18]. Could anyone please help me with that?
Thanks a lot in advance!

採用された回答

KSSV
KSSV 2020 年 2 月 5 日
iwant = max(A(:,[2 3]),[],2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by