Skip to content

Instantly share code, notes, and snippets.

View bcetin's full-sized avatar

Burak Çetin bcetin

View GitHub Profile
@Atlas7
Atlas7 / octave_tip.md
Last active December 23, 2021 17:25
Octave - find the min (or max) value of a Matrix, and the associated row and column

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: