Finding array with maximum value at each row

8 次查看(过去 30 天)
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 个评论
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by