Finding the last maximum value in a vector

6 visualizaciones (últimos 30 días)
Ghulam
Ghulam el 4 de Nov. de 2019
Comentada: Ghulam el 4 de Nov. de 2019
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

Respuesta aceptada

ME
ME el 4 de Nov. de 2019
I think this should do it for you:
idx = max(find(A==max(max(A))))
  8 comentarios
Ghulam
Ghulam el 4 de Nov. de 2019
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 el 4 de Nov. de 2019
I found it.
max(find(Max>round(mean(Max))))

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by