Source: https://www.math.univ-paris13.fr/~chaussar/Teaching/2016-2017/INGE1/Matlab/TP/TP2/Matlab_TP2.pdf