max value
조회 수: 6 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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.
댓글 수: 0
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!