MATLAB: How to extract two equal maximum values at different index

different lndexMATLAB

Hi guys,
How can I point out the different location of two maximum values
example A = [8,5,6,7,8]
If i type [max_A, index] = max(A), it will give me max = 8 and index = 1, but in this case the index must be 1 and 5.

Best Answer

index=find(A==max(A))
This should give you the indexes.