% Az octave help elsõ demó példája, lásd
% demo interp1
clc

xf = [0:0.05:10];
yf = sin (2*pi*xf/5);
xp = [0:10];
yp = sin (2*pi*xp/5);
lin = interp1 (xp, yp, xf);
near = interp1 (xp, yp, xf, "nearest");
pch = interp1 (xp, yp, xf, "pchip");
spl = interp1 (xp, yp, xf, "spline");
plot (xf,yf,"r", xf,near,"g", xf,lin,"b", xf,pch,"c", xf,spl,"m",xp,yp,"r*");
legend ("eredeti f(x)", "lépcsõs", "lineáris", "Hermite interpolációs", "spline");

input('Befejezés ENTER-rel');
close
