フィルターのクリア

max value

2 ビュー (過去 30 日間)
osman yurdakul
osman yurdakul 2011 年 3 月 22 日
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 日
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 件)

Paulo Silva
Paulo Silva 2011 年 3 月 22 日
find(x==max(x))

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by