-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotNoPertHitSmooth.m
30 lines (27 loc) · 1.19 KB
/
plotNoPertHitSmooth.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
function plotNoPertHitSmooth(extractData, time_of_interest)
for i = 1 : length(extractData.posHitNoPert) % plot all hit trials
subplot(2,2,1)
q = plot([0:extractData.sampleTime:(extractData.sampleTime*length(extractData.posHitNoPert{i})-extractData.sampleTime)], extractData.posHitNoPert{i}, 'b');
q.Color(4) = 0.2;
xlim([0 time_of_interest])
xlabel('Time (ms)')
ylabel('Angle (deg)')
hold on
subplot(2,2,2)
smoothVel = cellfun(@smooth, extractData.velHitNoPert, 'UniformOutput', 0);
q = plot([0:extractData.sampleTime:(extractData.sampleTime*length(extractData.velHitNoPert{i})-extractData.sampleTime)], smoothVel{i}, 'b');
q.Color(4) = 0.2;
xlabel('Time (ms)')
ylabel('Velocity (deg / s)')
xlim([0 time_of_interest])
hold on
subplot(2,2,3)
if length(extractData.velHitNoPert{i}) > 1
q = plot([0:extractData.sampleTime:(extractData.sampleTime*length(extractData.velHitNoPert{i})-2*extractData.sampleTime)],diff(smoothVel{i}) / (extractData.sampleTime * 1e-3), 'b');
q.Color(4) = 0.2;
xlabel('Time (ms)')
ylabel('Acceleration (deg / s^2)')
xlim([0 time_of_interest])
hold on
end
end