% Il fenomeno di Runge, si veda Quarteroni-Saleri, pagg. 83, 84.
f = inline('1./(1+x.^2)')
x = linspace(-5,5);
y = f(x);
plot(x,y)
hold on
n = 9;
nodi = linspace(-5, 5, n)
ynodi = f(nodi);
polint = polyfit(nodi, ynodi, n-1);
length(polint)
ypol = polyval(polint, x);
plot(x,ypol,'r')
n = 13;
nodi = linspace(-5, 5, n);
ynodi = f(nodi);
polint = polyfit(nodi, ynodi, n-1);
ypol = polyval(polint, x);
plot(x,ypol,'k')
quit
# Octave 3.6.4, Mon Nov 18 13:01:26 2013 W. Europe Standard Time <unknown@achilles-TOSH>
