-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotTrajectoryTrial.m
44 lines (37 loc) · 1020 Bytes
/
plotTrajectoryTrial.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
40
41
42
43
44
function plotTrajectoryTrial(extractedTrial, pert)
figure
for i = 1:length(extractedTrial)
subplot(3,1,1)
hold on
if pert(i) == 1
q1 = plot(extractedTrial{i, 1}, 'b');
else
q2 = plot(extractedTrial{i, 1}, 'r');
end
subplot(3,1,2)
hold on
if pert(i) == 1
g1 = plot(extractedTrial{i, 2}, 'b');
else
g2 = plot(extractedTrial{i, 2}, 'r');
end
subplot(3,1,3) % plot perturbation current
hold on
if pert(i) == 1
c1 = plot(extractedTrial{i, 3}, 'b');
end
end
subplot(3,1,1)
xlabel('Time (ms)')
ylabel('Turn Angle (deg)')
title('Turn Angle Trajectories for Rewarded Trials')
legend([q1 q2], 'Perturbed', 'Unperturbed')
subplot(3,1,2)
xlabel('Time (ms)')
ylabel('Velocity (rpm)')
title('Turn Angle Velocity for Rewarded Trials')
legend([g1 g2], 'Perturbed', 'Unperturbed')
subplot(3,1,3)
xlabel('Time (ms)')
ylabel('Perturbation Voltage (max 10V)')
title('Perturbation Magnitude for Rewarded Trials')