% régression polynomiale x = [ -4.1 -3.2 -1.8 -1 0 0.95 2.1 2.9 4.0 ] y = [ 26 15.2 8.1 3.9 1.8 3.7 7.7 16 24.5 ] p = polyfit (x,y,2) y_calc = polyval(p,-4.1:0.1:4.1); figure; hold on plot(x,y,'d') plot(-4.1:0.1:4.1, y_calc) y_approx = polyval (p, x) % calcul des erreurs delta_y = y - y_approx sigma = std (delta_y) % tracer les barres d'erreur sur le graphique errorbar (x, y, sigma*2 * ones(size(x)), 'or') hold off xlabel ('x'); ylabel('y'); title ('Approximation parabolique')