Source: https://perso.ensta-paris.fr/~chambey/Enseignement/TP-Matlab/MA261-Cor.pdf