% A "m" file for Matlab. After making a "wave_dat" file from "grfft.f", you
% can plot waveforms using Matlab. A post script data is stored in the 
% "wave.ps" file.

clear
close

fig=figure('Units','centimeters','Position',[0.0 0.0 21.0 27.0]...
,'PaperUnits','centimeters','PaperPosition',[0.0 0.0 21.0 27.0]);

load t078_d1
data1=t078_d1;
[nt,n]=size(data1)
load t079_d1
data2=t079_d1;
load t089_d1
data3=t089_d1;
load t084_d1
data4=t084_d1;
load t074_d1
data5=t074_d1;

for i=1:nt,
t1(i)=data1(i,1);
t2(i)=data2(i,1);
t3(i)=data3(i,1);
t4(i)=data4(i,1);
t5(i)=data5(i,1);
x1(i)=data1(i,2);
x2(i)=data2(i,2)+100;
x3(i)=data3(i,2)+200;
x4(i)=data4(i,2)+300;
x5(i)=data5(i,2)+400;
y1(i)=data1(i,3);
y2(i)=data2(i,3)+100;
y3(i)=data3(i,3)+200;
y4(i)=data4(i,3)+300;
y5(i)=data5(i,3)+400;
z1(i)=data1(i,4);
z2(i)=data2(i,4)+100;
z3(i)=data3(i,4)+200;
z4(i)=data4(i,4)+300;
z5(i)=data5(i,4)+400;
end

subplot(3,3,7)
plot(t1,x1,t2,x2,t3,x3,t4,x4,t5,x5)
text(60,-50,'TCU078')
text(60, 50,'TCU079')
text(60,150,'TCU089')
text(60,250,'TCU084')
text(60,350,'TCU074')
axis([0,100,-100,600])
xlabel('time (sec)')
ylabel('displacement (cm)')
title('DIS(UD)')
grid

subplot(3,3,8)
plot(t1,y1,t2,y2,t3,y3,t4,y4,t5,y5)
text(60, 50,'TCU078')
text(60,150,'TCU079')
text(60,250,'TCU089')
text(60,360,'TCU084')
text(60,470,'TCU074')
axis([0,100,-100,600])
xlabel('time (sec)')
title('DIS(NS)')
grid

subplot(3,3,9)
plot(t1,z1,t2,z2,t3,z3,t4,z4,t5,z5)
text(60,-120,'TCU078')
text(60,-40,'TCU079')
text(60,50,'TCU089')
text(60,130,'TCU084')
text(60,250,'TCU074')
axis([0,100,-200,500])
xlabel('time (sec)')
title('DIS(EW)')
grid


load t078_v1
data1=t078_v1;
[nt,n]=size(data1)
load t079_v1
data2=t079_v1;
load t089_v1
data3=t089_v1;
load t084_v1
data4=t084_v1;
load t074_v1
data5=t074_v1;

for i=1:nt,
t1(i)=data1(i,1);
t2(i)=data2(i,1);
t3(i)=data3(i,1);
t4(i)=data4(i,1);
t5(i)=data5(i,1);
x1(i)=data1(i,2);
x2(i)=data2(i,2)+100;
x3(i)=data3(i,2)+200;
x4(i)=data4(i,2)+300;
x5(i)=data5(i,2)+400;
y1(i)=data1(i,3);
y2(i)=data2(i,3)+100;
y3(i)=data3(i,3)+200;
y4(i)=data4(i,3)+300;
y5(i)=data5(i,3)+400;
z1(i)=data1(i,4);
z2(i)=data2(i,4)+100;
z3(i)=data3(i,4)+200;
z4(i)=data4(i,4)+300;
z5(i)=data5(i,4)+400;
end

subplot(3,3,4)
plot(t1,x1,t2,x2,t3,x3,t4,x4,t5,x5)
text(60,-40,'TCU078')
text(60, 60,'TCU079')
text(60,160,'TCU089')
text(60,260,'TCU084')
text(60,360,'TCU074')
%axis([t1,t2,-amax,amax])
xlabel('time (sec)')
ylabel('Velocity (cm/sec)')
title('VEL(UD)')
grid

subplot(3,3,5)
plot(t1,y1,t2,y2,t3,y3,t4,y4,t5,y5)
text(60,-40,'TCU078')
text(60, 60,'TCU079')
text(60,160,'TCU089')
text(60,260,'TCU084')
text(60,360,'TCU074')
%axis([t1,t2,-amax,amax])
xlabel('time (sec)')
title('VEL(NS)')
grid

subplot(3,3,6)
plot(t1,z1,t2,z2,t3,z3,t4,z4,t5,z5)
text(60,-40,'TCU078')
text(60, 60,'TCU079')
text(60,160,'TCU089')
text(60,260,'TCU084')
text(60,360,'TCU074')
%axis([t1,t2,-amax,amax])
xlabel('time (sec)')
title('VEL(EW)')
grid


load t078_a1
data1=t078_a1;
[nt,n]=size(data1)
load t079_a1
data2=t079_a1;
load t089_a1
data3=t089_a1;
load t084_a1
data4=t084_a1;
load t074_a1
data5=t074_a1;

for i=1:nt,
t1(i)=data1(i,1);
t2(i)=data2(i,1);
t3(i)=data3(i,1);
t4(i)=data4(i,1);
t5(i)=data5(i,1);
x1(i)=data1(i,2);
x2(i)=data2(i,2)+1000;
x3(i)=data3(i,2)+2000;
x4(i)=data4(i,2)+3000;
x5(i)=data5(i,2)+4000;
y1(i)=data1(i,3);
y2(i)=data2(i,3)+1000;
y3(i)=data3(i,3)+2000;
y4(i)=data4(i,3)+3000;
y5(i)=data5(i,3)+4000;
z1(i)=data1(i,4);
z2(i)=data2(i,4)+1000;
z3(i)=data3(i,4)+2000;
z4(i)=data4(i,4)+3000;
z5(i)=data5(i,4)+4000;
end

subplot(3,3,1)
plot(t1,x1,t2,x2,t3,x3,t4,x4,t5,x5)
text(60,-400,'TCU078')
text(60, 600,'TCU079')
text(60,1600,'TCU089')
text(60,2600,'TCU084')
text(60,3600,'TCU074')
%axis([t1,t2,-amax,amax])
ylabel('acceleration (gal)')
xlabel('time (sec)')
title('ACC(UD)')
grid

subplot(3,3,2)
plot(t1,y1,t2,y2,t3,y3,t4,y4,t5,y5)
text(60,-400,'TCU078')
text(60, 600,'TCU079')
text(60,1600,'TCU089')
text(60,2600,'TCU084')
text(60,3600,'TCU074')
%axis([t1,t2,-amax,amax])
xlabel('time (sec)')
title('ACC(NS)')
grid

subplot(3,3,3)
plot(t1,z1,t2,z2,t3,z3,t4,z4,t5,z5)
text(60,-400,'TCU078')
text(60, 600,'TCU079')
text(60,1600,'TCU089')
text(60,2600,'TCU084')
text(60,3600,'TCU074')
%axis([t1,t2,-amax,amax])
xlabel('time (sec)')
title('ACC(EW)')
grid


%print
%print -dgif8 a.gif
%print vel1.ps -dps

