Whilst working through the many (Octave) coding assignment from Andrew Ng's Stanford Machine Learning course, a common problem that I have to solve revolves around this:
Given a Matrix A with m rows, and n columns find the mininum (or maximum) value and the associated row and column number
This article summarises my solution to this problem (which, hopefully this will also come in hadny to you!). Note that Octave index start from 1 (instead of 0).
Say we have a Matrix A that look like this: