MATLAB: Finding the last maximum value in a vector

matrix array

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

Best Answer

I think this should do it for you:
idx = max(find(A==max(max(A))))