https://www.mathworks.com/matlabcentral/answers/100813-how-do-i-find-the-indices-of-the-maximum-or-minimum-value-of-my-matrix#answer_282157
This apparently solved your question, however for future reference I would like to mention that there is an earier solution that does not involve declaring a function.
Lets continue with any matrix A. The first step is finding the minimum value of the complete matrix with:
The double min is needed to first find min of all columns, then find min of all those min values. (there might be an easier way for this as well).
Finding the indices of this value can be done like this:
2 lines will be easier than a complete function.