% banaherm.m, hermiteinterpolation
  clear, clf
  x=[0.5 1.5 2.5 3 4 5]';  y=[3 1.5 1.5 1 1 0]'; 
  subplot(2,2,1), plot(x,y,'o'), axis equal,  hold on
  k=[0; (y(3:6)-y(1:4))./(x(3:6)-x(1:4)); 0];   % Derivatorna
  h=diff(x);  dy=diff(y);
  g=h.*k(1:5)-dy;  c=2*dy-h.*(k(1:5)+k(2:6)); 
  t=0:0.1:1;
  for i=1:5         % Beräkna polynomvärdena i de fem delintervallen
    xt=x(i)+t*h(i);
    yt=y(i)+t*dy(i)+t.*(1-t)*g(i)+t.^2.*(1-t)*c(i);  plot(xt,yt)
  end
  title('Derivata approx av differenskvot')



