I just want to find all the indices of the maximum value in a vector in matlab. the max function returns only the index of the first occurence of the maximum. For example:
maxChaqueCell = [4 5 5 4]
[maximum, indicesDesMax] = max(maxChaqueCell)
maximum =
5
indicesDesMax =
2
I need the indicesDesMax
to have 2 and 3 which are the indices of the two 5 we have in maxChaqueCell
, how can I do that?
Thanks.