19 lines
362 B
Matlab
19 lines
362 B
Matlab
function[p] = newton_interpol_f(F, n, a, b, xx)
|
|
|
|
% Programm berechnet den Wert des Newtonschen Interpolationspolynoms p(x) der
|
|
% Funktion f zu n+1 Stuetzstellen auf dem Intervall [a,b]
|
|
|
|
% Berechne Stuetzstellen:
|
|
h=(b-a)/n;
|
|
x=zeros(n+1,1);
|
|
for i=1:n+1
|
|
x(i)=a+(i-1)*h
|
|
end
|
|
|
|
y=zeros(n+1,1);
|
|
for i=1:n+1
|
|
y(i)=feval(F, x(i));
|
|
end
|
|
|
|
p=newton_interpol(xx,x,y,n);
|