Skip to content

Instantly share code, notes, and snippets.

Avatar

Burak Çetin bcetin

View GitHub Profile
@Atlas7
Atlas7 / octave_tip.md
Last active Jul 10, 2020
Octave - find the min (or max) value of a Matrix, and the associated row and column
View octave_tip.md

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).

Sample Matrix

Say we have a Matrix A that look like this: