function Q=hermite(x,y,yp)
n=length(x)-1;
for i=0:n
    z(2*i+1)=x(i+1);
    z(2*i+2)=x(i+1);
    Q(2*i+1,1)=y(i+1);
    Q(2*i+2,1)=y(i+1);
    Q(2*i+2,2)=yp(i+1);
    if i ~= 0
        Q(2*i+1,2)=(Q(2*i+1,1)-Q(2*i,1))/(z(2*i+1)-z(2*i-1));
    end
end
for i=2:2*n+1
    for j=2:i
        Q(i+1,j+1)=(Q(i+1,j)-Q(i,j))/(z(i+1)-z(i-j+1));
    end
end

% H=hermite([1.3 1.6 1.9],[0.6200860 0.4554022 0.2818186],[-0.5220232 -0.5698959 -0.5811571])
% 