
close all
clear all
dt = 0.1;

x = -50:1:50;
t = 0:dt:200;


wave = IncWave;


figure
h1 = plot(t,eta(wave,0,t));
aa = axis;
xx = [0 0];
yy = [aa(3) aa(4)];
l1 = line(xx,yy,'Color','r');
set(h1,'EraseMode','xor')
title('Wave Elevation at x=0');
xlabel('time (s)');
ylabel('\eta_0 (m)')'

eta0 = eta(wave,x,t);
figure
h2 = plot(x,eta0(1,:));
aa = axis;
aa(3) = min(min(eta0));
aa(4) = max(max(eta0));
axis(aa);
set(h2,'EraseMode','xor')
t1 = text(aa(2)-60,aa(4)-0.1,['Time = ',num2str(0.0,'%4.3f'),' seconds']);
title('Wave Elevation');
xlabel('x (m)');
ylabel('\eta (m)');


for i = 1:length(t)
set(h2,'YData',eta0(i,:));
set(t1,'String',['Time = ',num2str(t(i),'%4.0f'),' seconds']);
set(l1,'XData',[t(i) t(i)]);
pause(dt);
end

