Take Home Final Exam
Take Home Final Exam
Question 2
Use Akima interpolation and Sinc interpolation for the given function for N = 10, 20, 40, 80,
160, 320, 640. Plot the graph of the function and for both Akima and Sinc for each N. You should
have seven plots. Also make an error table like Table 1 on the reference paper for both
interpolations.
MATLAB Script for Sinc Interpolation
% Define the function to be interpolated
function_value = @(x) 2*x.^2 + x - 3*x.^3;
% Akima interpolation
yi = zeros(size(x_interpolation));
for j = 1:length(x_interpolation)
% Find the nearest indices in x for x_interpolation(j)
[~, idx] = min(abs(x_original - x_interpolation(j)));
xlabel('x')
ylabel('f(x)')
title(['Akima Interpolation for N = ', num2str(N)])
legend('Interpolated function', 'Original function')
end
Plot