close all

sampleRate = 40;
time = 1/sampleRate * 1:length(VNYMR.AccX);

for i=1:2:14
    index = uint16(i/2 + 0.5);
    pitch(index) = mean(VNYMR.Pitch(x1(i):x1(i+1)));
    roll(index) = mean(VNYMR.Roll(x1(i):x1(i+1)));
    yaw(index) = mean(VNYMR.Yaw(x1(i):x1(i+1)));
    accelFromPitch(index) = 9.8 * sind(pitch(index))
    accelX(index) = mean(VNYMR.AccX(x1(i):x1(i+1)))
    accelY(index) = mean(VNYMR.AccY(x1(i):x1(i+1)));
    accelZ(index) = mean(VNYMR.AccZ(x1(i):x1(i+1)));
end

difference = accelFromPitch - accelX

x = 1:7;
plot(x,accelFromPitch,'-o',x,accelX,'-+')
    