MATLAB: Is there a way with the min function to determine all indexes that represent the minimum

indexingMATLABmin

[minx,indx] = min(x) will return the minimum value in the array and the location. The issue I have is that I have multiple occurrences of the minimum and would like to know all the locations. When there are multiple the function only returns the first location it finds the minimum. I can write a condition to determine it, but wondering if there is a built in way with the min function to output this information.

Best Answer

No, there is not. You need to use
indx = find(x == min(x))
or similar.