%plotAtsXYZ.m
% 
% Vivek Nadkarni
% Trimble
% December 15, 2004

new;
atsxyz = load('ATStraj_XYZ.txt');

time = atsxyz(:,1);
X = atsxyz(:,2);
Y = atsxyz(:,3);
Z = atsxyz(:,4);

figure(1);

subplot(3,1,1);
plot(time,X);
title('X');

subplot(3,1,2);
plot(time,Y);
ylabel('meters');
title('Y');

subplot(3,1,3);
plot(time,Z);
xlabel('seconds');
title('Z');

figure(2);

subplot(3,1,1);
plot(X);
grid minor; 
title('X');

subplot(3,1,2);
plot(Y);
grid minor; 
ylabel('meters');
title('Y');

subplot(3,1,3);
plot(Z);
grid minor; 
xlabel('index');
title('Z');



seg3Start = 430;
seg3End = 560; 

seg4Start = 620;
seg4End = 760;

segStart = seg3Start;
segEnd = seg3End; 

format long
avgX = mean(X(segStart:segEnd))
avgY = mean(Y(segStart:segEnd))
avgZ = mean(Z(segStart:segEnd))

