Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Get detailed answers to your questions from a community of experts dedicated to providing accurate information. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.

given the data x: 1 2 3 5 6 f(x): 15 8 5.5 30 52 calculate f (4) using (a) newton's interpolating polynomials of order 4, (b) cubic spline with not-a-knot end conditions, (c) cubic spline with zero-slope clamped end conditions, and (d) piecewise cubic hermite interpolation.

Sagot :

The f(4) using is found using newton's interpolating polynomials of order 4.

function y=CL10_Exercise(part)

%% Input

% part: string for part a,b,c,d

%

%% Output

% y value of the underlying function at x=4

%

%% Write your code here

X=[1,2,3,5,6];

Y=[15,8,5.5,30,52];

x=4;

y=1;

switch part

case 'a'

%% Newton interpolation (Order 4)

a=X;

b=Y;

%x=input('Enter x: ');

[m,n]=size(a);

fx=0;

for i=1:n

%_____________Calculating Dividing Difference_____________________

s=0;

for j=1:i

p=1;

for k=1:i %Denominator part product

if(k~=j)

p=p*(a(j)-a(k));

end

end

s=s+b(j)/p; %summation f(x)/product

end

%_________________________________________________________________

p=1;

for j=1:i-1 %coefficient part of f[...]

p=p.*(x-a(j));

end

fx=fx+s.*p; %Polynomial!

end

y=fx;

case 'b'

%% not-a-knot spline

case 'c'

%% clamped spline

case 'd'

%% Hermite spline

end

end

Hence, the f(4) using is found using newton's interpolating polynomials of order 4.

To learn more about interpolation click here:

brainly.com/question/18768845

#SPJ4