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