et's suppose i have an array like:
x = [1 2 35 33]
and i'd like to find which element is the max element of this array...
i mean max(x) = 35 but i do not know the row of the max value but in x it's the third element. but if i do not know this how can i find?
thanks for your helps

 采纳的回答

Matt Fig
Matt Fig 2011-3-22

3 个投票

Better to use the capabilities of MAX, than to use FIND and a comparison.
[mx,I] = max(x); % mx is the maximum value, I is the location.

更多回答(1 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Elementary Math 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by