Finding array with maximum value at each row

9 ビュー (過去 30 日間)
sushma sharma
sushma sharma 2013 年 4 月 20 日
hi,
i have three 10 x 1 arrays, a, b, and c. how can i write a function that show which array has the highest value at each row. the output will be something like this: a c b b a .... any help would be appreciated! sushma

採用された回答

the cyclist
the cyclist 2013 年 4 月 20 日
>> [~,idx] = max([a,b,c],[],2)
idx will be 1,2, or 3, indicating whether a,b, or c has the max.
  2 件のコメント
sushma sharma
sushma sharma 2013 年 4 月 20 日
thank you!
the cyclist
the cyclist 2013 年 4 月 20 日
編集済み: the cyclist 2013 年 4 月 20 日
Since my answer solved your issue, please consider accepting it, for the benefit of those seeking similar solutions in the future.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by