Source: http://wp.unil.ch/risk/files/2014/01/1.-Introduction-%25C3%25A0-Matlab.pdf