필터 지우기
필터 지우기

Finding the last maximum value in a vector

조회 수: 16 (최근 30일)
Ghulam
Ghulam 2019년 11월 4일
댓글: Ghulam 2019년 11월 4일
Hi,
"max" gives the maximum value of a matrix in a row vector.
This vector contains all the maximum values in the respective column.
if i use [V,X]= max(max(A)) this will give me the largest value of the vector in the corresponding X.
Definitely in the vector there are many values which are equal to max(max(A))
I want to know that how can i know the last index that has this value in the vector.
Pls guide me.
Thanks

채택된 답변

ME
ME 2019년 11월 4일
I think this should do it for you:
idx = max(find(A==max(max(A))))
  댓글 수: 8
Ghulam
Ghulam 2019년 11월 4일
Regarding the same question of finding the index of max value.
If i say that i want to find out at which index after this index (i mean the above we calculated) the value become x
Ghulam
Ghulam 2019년 11월 4일
I found it.
max(find(Max>round(mean(Max))))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by