I’m trying to write a script in MATLAB that finds the location of the minimum value of a 2D array of numbers. I am certain there is only 1 minimum in this array, so having multiple locations in the array with the same minimum value is not an issue. I can find the minimum value of the array, but in a 30×30 array, I would like to know which row and column that minimum value is in.
Share
As an alternative version, combine min to get the minimum value and find to return the index, if you’ve already calculated the minimum then just use find.
Or depending on how you want to use the location information you may want to define it with a logical array instead, in which case logical addressing can be used to give you a truth table.