Source: https://w3.ens-rennes.fr/math/people/gregory.vial/files/matsci/prg_matlab.pdf