clear; clc; close all;

x = linspace(0, 8 * pi, 100);
figure;
h = plot(x, sin(x) .* exp(-x / 5));
axis([-inf inf -1 1]); grid on;
for i = 1 : 5000
    y = sin(x - i / 10) .* exp(-x / 5);
    set(h, 'ydata', y);
    drawnow;
end
