Source: https://www.uni-due.de/imperia/md/content/numerik/ws1011/matlab.pdf