% Test with the board example
x = [-2 -1 0 1 2];
y = [1 4 11 16 13];
a = pfit(x,y)

xTest = linspace(-2, 2, 40);
yTest = peval(a, x, xTest);

plot(x,y, 'r*')
hold on
plot(xTest, yTest);



% Runge function
x = linspace(-5, 5, 31);
y = 1./(1+x.^2);
figure;
a = pfit(x,y)

xTest = linspace(-5, 5, 40);
yTest = peval(a, x, xTest);

plot(x,y, 'r*')
hold on
plot(xTest, yTest);
