%Uppswinget (Kopierat från kaffekopp.m)
clear all
g=9.82;
load uppswinget_wdss -ascii
% indata : tid(s), höjd(m), ay, ax, az (m/s^2)
% x - fram/bak, z=vertikal, y=sidled
am_short=uppswinget_wdss(161:1401,:);

tid=am_short(:,1)-am_short(1,1);
hojd =am_short(:,2);
alat =am_short(:,3)/g;
along =am_short(:,4)/g;
avert =am_short(:,5)/g;  


figure(1)
subplot (2,1,1)
plot(tid,avert) 
ylabel ('a_{vert}/g')
axis([0 60 -1 4])
grid on

subplot(2,1,2)
plot(tid,hojd)
axis([0 60 -15 25])
grid on
ylabel ('hojd (m)')
xlabel('t(s)')

figure (2)
subplot(3,1,1)
plot(tid,avert,tid, along) 
ylabel ('a_{long}/g, a_{vert}/g')
axis([0 60 -1 4])
grid on


subplot(3,1,2)
plot(tid,along)
axis([0 15 -1 1])
grid on
ylabel ('a_{long}/g')
xlabel('t(s)')

subplot(3,1,3)
plot(tid,along)
axis([45 60 -1 1])
grid on
ylabel ('a_{long}/g')
xlabel('t(s)')

figure (3)
atot=(along.^2+alat.^2+avert.^2).^0.5;
subplot(2,1,1)
plot(tid,atot,tid,avert)
axis([0 60 -0.5 3.5])
grid on
ylabel ('g_vert, g_tot')
xlabel('t(s)')


