% Interpolation examples
% Minas Spetsakis Nov. 2017

X=1:12;
Y=rand(1,10);
Y=conv(Y,[.5,1,.5]);
plot(X,Y,'d');
hold on;
fplot(@(x)interp1(X,Y,x,'nearest'),[1,12],'r');
fplot(@(x)interp1(X,Y,x,'spline'),[1,12],'b');
fplot(@(x)interp1(X,Y,x,'pchip'),[1,12],'g');
fplot(@(x)myinterp1l(Y,x),[-2,14],'m');
hold off;  
