clear; clc; close all;

x = linspace(0, 4 * pi, 10);
y = sin(x) .* exp(-x / 5);
xi = 0 : 0.1 : 4 * pi;
figure;
plot(xi, sin(xi) .* exp(-xi / 5)); grid on; hold on;
plot(x, y, 'o'); 
y1 = interp1(x, y, xi, 'linear');
y2 = interp1(x, y, xi, 'spline');
plot(xi, y1, '--');
plot(xi, y2, '--');
legend({'Original curve', ...
        'Sampled points', ...
        'Linear interpolation',...
        'Spline interpolation'});