Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Someone can explain this hermit interpolation algorithm with example?

Thank you,

function [H]=hermite(X,x,f,fd);
m=length(x);
for i=1:m
    z(2*i-1)=x(i);
    Q(2*i-1,1)=f(i);
    z(2*i)=x(i);
    Q(2*i,1)=f(i);
    Q(2*i,2)=fd(i); 
    if i~=1
        Q(2*i-1,2)=(Q(2*i-1,1)-Q(2*i-2,1))/(z(2*i-1)-z(2*i-2));
    end;
end;
for i=3:2*m
    for j=3:i
        Q(i,j)=(Q(i,j-1)-Q(i-1,j-1))/(z(i)-z(i-j+1));
    end
end
p=1;
H=Q(1,1);
for i=2:2*m
    p=p.*(X-z(i-1));
    H=H+p.*Q(i,i);
end;
share|improve this question
    
You'll want to see Krogh's paper. –  J. M. Nov 4 '11 at 1:01

1 Answer 1

The next time you post raw code, please show the basic courtesy of telling us what language it's in.

You'll find an explanation of the algorithm underlying this code together with an example in the Wikipedia article on Hermite interpolation, unsurprisingly. Also take note of the article on divided differences that it links to. If there is something in those articles that you don't understand, please ask a specific question about that particular aspect.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.