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