-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlotSampleTrial.m
39 lines (37 loc) · 1.62 KB
/
PlotSampleTrial.m
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
% to be run after ReadAndProcessYEIData.m
close;
i = 140;
Start = 5;
End = 10;
Indices = 1:length(FilteredData(i).TimeInSeconds);
SelectedIndices = Indices(...
FilteredData(i).TimeInSeconds > 5 & FilteredData(i).TimeInSeconds < 10 );
SelectedTime = FilteredData(i).TimeInSeconds(SelectedIndices);
SelectedTime = SelectedTime - SelectedTime(1);
figure(1);
plot(SelectedTime, FilteredData(i).XGyro(SelectedIndices), 'r', ...
SelectedTime, FilteredData(i).ZGyro(SelectedIndices), 'g', ...
SelectedTime, FilteredData(i).YGyro(SelectedIndices), 'b', ...
'LineWidth', 2)
xlabel('Time (s)'); ylabel('Velocity (deg/s)');
legend('Roll', 'Pitch', 'Yaw')
title('Sample Tracing for Walking')
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 11 8])
print(gcf, '-dpng', '-r150', '../../Figures/SampleWalkTracing.png')
figure(2);
FrequencyIndices = 1:length(FilteredData(i).Frequencies);
SelectedFrequencyIndices = FrequencyIndices(...
FilteredData(i).Frequencies < 5 );
SelectedFrequencies = FilteredData(i).Frequencies(SelectedFrequencyIndices);
plot(SelectedFrequencies, ...
FilteredData(i).FilteredXFrequency(SelectedFrequencyIndices), 'r', ...
SelectedFrequencies, ...
FilteredData(i).FilteredZFrequency(SelectedFrequencyIndices), 'g', ...
SelectedFrequencies, ...
FilteredData(i).FilteredYFrequency(SelectedFrequencyIndices), 'b', ...
'LineWidth', 2);
xlabel('Frequency (Hz)'); ylabel('Magnitude')
legend('Roll', 'Pitch', 'Yaw');
title('Sample Frequency Components for Walking');
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 11 8])
print(gcf, '-dpng', '-r150', '../../Figures/SampleWalkFrequencies.png')