Source: https://perso.telecom-paristech.fr/rodrigez/resources/ENS/poly_matlab.pdf