forked from JD-Kidd/7_DataAnalysisSuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotGPSData.m
More file actions
99 lines (88 loc) · 2.3 KB
/
plotGPSData.m
File metadata and controls
99 lines (88 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
function plotGPSData( t, p, h, k )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Author: Marshall Herr
%%%
%%% Purpose: Takes in a time vector and position vectors and shows these in
%%% terms of the principal direction of travel, the horizontal direction,
%%% and the "vertical" direction
%%%
%%% Inputs:
%%% - t: Time vector in seconds
%%% - x: East position from origin in meters
%%% - y: North position from origin in meters
%%% - z: Zenith position from origin in meters
%%% - u: Eastward velocity from origin in meters per second
%%% - v: Northward velocity from origin in meters per second
%%% - w: Zenith-ward velocity from origin in meters per second
%%%
%%% Date Created: 21 Feb 2019
%%% Last Editted: 21 Feb 2019
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Formatting
numBoxes = 100;
% Standard Deviations and Means
sP = std(p);
mP = mean(p);
sH = std(h);
mH = mean(h);
sK = std(k);
mK = mean(k);
% Plotting
figure;
ax = subplot(3,2,1);
plot(t,p)
hold on
plot(t,0.*p+mP,'-g')
plot(t,0.*p+mP+sP,'-r')
plot(t,0.*p+mP-sP,'-r')
ylabel('Principal Position [m]')
title('Position VS Time')
axis tight
subplot(3,2,2);
histfit(p,numBoxes)
y_lim = get(gca,'YLim');
hold on
plot([mP,mP],[y_lim(1),y_lim(2)],'-g')
plot([mP-sP,mP-sP],[y_lim(1),y_lim(2)],'-r')
plot([mP+sP,mP+sP],[y_lim(1),y_lim(2)],'-r')
ylabel('Principal Position Counts')
title('Position Histograms')
ylim(y_lim)
ay = subplot(3,2,3);
plot(t,h)
hold on
plot(t,0.*h+mH,'-g')
plot(t,0.*h+mH+sH,'-r')
plot(t,0.*h+mH-sH,'-r')
ylabel('Horizontal Position [m]')
axis tight
subplot(3,2,4);
histfit(h,numBoxes)
y_lim = get(gca,'YLim');
hold on
plot([mH,mH],[y_lim(1),y_lim(2)],'-g')
plot([mH-sH,mH-sH],[y_lim(1),y_lim(2)],'-r')
plot([mH+sH,mH+sH],[y_lim(1),y_lim(2)],'-r')
ylabel('Horizontal Position Counts')
ylim(y_lim)
az = subplot(3,2,5);
plot(t,k)
hold on
plot(t,0.*k+mK,'-g')
plot(t,0.*k+mK+sK,'-r')
plot(t,0.*k+mK-sK,'-r')
ylabel('Vertical Position [m]')
xlabel('Time [s]')
axis tight
subplot(3,2,6);
histfit(k,numBoxes)
y_lim = get(gca,'YLim');
hold on
plot([mK,mK],[y_lim(1),y_lim(2)],'-g')
plot([mK-sK,mK-sK],[y_lim(1),y_lim(2)],'-r')
plot([mK+sK,mK+sK],[y_lim(1),y_lim(2)],'-r')
ylabel('Vertical Position Counts')
xlabel('Position [m]')
ylim(y_lim)
linkaxes([ax,ay,az],'x')
end