Asked by sushma sharma
on 20 Apr 2013

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

*No products are associated with this question.*

Answer by the cyclist
on 20 Apr 2013

Accepted answer

>> [~,idx] = max([a,b,c],[],2)

idx will be 1,2, or 3, indicating whether a,b, or c has the max.

the cyclist
on 20 Apr 2013

Opportunities for recent engineering grads.

## 0 Comments