A=(rawacclog.*2)./32767;

figure(1);
plot(A(:,:,2));
grid on;
ylabel('g');
legend('X','Y','Z');
axis([0 1000 -1.5 1.5])


G=(rawgyrolog.*3.3)./(1023.*0.0083);
G(:,2,:)=-G(:,2,:); % gyroscope y axis needs to be inverted to match with accelerometer Y axis

figure(2);
plot(G(:,:,2))
axis([0 1000 -50 50])
grid on
ylabel('º/S')
legend('X','Y')

figure(3)
plot(anglelog)
grid on
ylabel('Degrees')
axis([0 1000 0 50])


if(exist('rolllog'))
    figure(4)
    plot(anglelog,'DisplayName','anglelog','YDataSource','anglelog');
    hold all;
    plot(rolllog,'DisplayName','rolllog','YDataSource','rolllog');
    hold all;
    hold off;
    figure(gcf);
    grid on;
    legend('Pedal','Roll');
    ylabel('Degrees')
    axis([0 1000 -60 60]);
end

mean(anglelog)
std(anglelog)

%clear all