%clear
close

amax=0.00003
load wave_d;
size(wave_d)
nob=wave_d(4,1)
nt=wave_d(4,2)
dt=wave_d(4,3)

for j=1:nt,
  wx(j)=wave_d(j+4,1);
  wy(j)=wave_d(j+4,2);
  wz(j)=wave_d(j+4,3);
  t(j)=dt*(j-1);
end
f=max(t)
ax=-1.5*min(wx)
ay=-1.5*min(wy)
az=-1.5*min(wz)
for j=1:nt,
  wx(j)=wave_d(nt*(nob-1)+j+4,1);
  wy(j)=wave_d(nt*(nob-1)+j+4,2);
  wz(j)=wave_d(nt*(nob-1)+j+4,3);
end
bx=+1.5*max(wx)
by=+1.5*max(wy)
bz=+1.5*max(wz)

subplot(1,3,1)
hold on
for i=1:nob,
  for j=1:nt,
    wx(j)=wave_d(nt*(i-1)+j+4,1)+ax+amax*(i-1)/2;
  end
  plot(t,wx)
end
hold off
title('NS')
set(gca, 'box','on')
axis([0 f 0 ax+bx+amax*(nob-1)/2])
ylabel('Velocity (cm/s)')
xlabel('time (sec)')

subplot(1,3,2)
hold on
for i=1:nob,
  for j=1:nt,
    wy(j)=wave_d(nt*(i-1)+j+4,2)+ay+amax*(i-1)/2;
  end
  plot(t,wy)
end
hold off
title('EW')
set(gca, 'box','on')
axis([0 f 0 ay+by+amax*(nob-1)/2])
xlabel('time (sec)')

subplot(1,3,3)
hold on
for i=1:nob,
  for j=1:nt,
    wz(j)=wave_d(nt*(i-1)+j+4,3)+az+amax*(i-1)/2;
  end
  plot(t,wz)
end
hold off
title('UD')
set(gca, 'box','on')
axis([0 f 0 az+bz+amax*(nob-1)/2])
xlabel('time (sec)')

print wavebx.ps


