
clear all;

N=10; a=0; b=2*pi;

f=inline('sin(x)');

hx=(b-a)/N;      % PASSO INTP. PTS.
x=a:hx:b;        % ASCISSE (INTP).
y=feval(f,x);      % ORDINATE (INTP).
h1=hx/1000;         % PASSO TEST PTS.
tx=a:h1:b;        % ASCISSE (TEST).
ty = interp1(x,y,tx,'linear');  % ORDINATE (TEST).
vv=feval(f,tx);     % VALORE ESATTO IN NODI TEST.

clf;
hold on;         % PLOT SPLINE VS. RUNGE.
% plot(tx,vv,'k-','LineWidth',2); % RUNGE.
plot(x,y,'k-','LineWidth',2); % SPLINE.
% legend('runge','spline 1');
plot(x,y,'ko','LineWidth',1,'MarkerFaceColor','c','MarkerSize',8); 
hold off
