function WaveEqnPluck()

T=10;
c=1;

t=[0:0.1:T];

x=[-3*c*T:0.1:3*c*T];

v = VideoWriter('WaveEqnPluck.avi');

open(v)

axis([x(1) x(end)  0 pi/(2*c)])

set(gca, 'nextplot', 'replacechildren');


for n=1:size(t,2)

u=(1/2*c)*(atan(x+c*t(n)) - atan(x-c*t(n)));

plot(x,u,'linewidth',2)

frame = getframe(gcf); 

hax=gca;
set(hax,'fontname','times','fontsize',18);
xlabel('Time')
ylabel('Amplitude')

str = 'Wave with initial velocity $g(x) = \frac{1}{1+x^2}$';

tha=title(str)
set(tha,'Interpreter','latex')


writeVideo(v,frame);

end

close(v);

