-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualise.m
52 lines (47 loc) · 1.32 KB
/
visualise.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
45
46
47
48
49
50
51
52
displacement_x = diff(velocities(:,1));
displacement_y = diff(velocities(:,2));
disp_mag = sqrt(displacement_x.^2 + displacement_y.^2);
t = linspace(0,42,length(velocities));
td = linspace(0,42,length(displacement_x));
angular_vel = diff(orientations);
% figure; Magnitudes of velocity and displacement.
% subplot(3,1,1)
% plot(td,disp_mag,'b');
% title('Displacement graph against Time ');
% xlabel('Time');
% ylabel('Displacement');
%
% subplot(3,1,2)
% plot(t,velocities(:,3),'r');
% title("Velocity Graph Against Time)");
% xlabel('Time');
% ylabel('Velocity');
%figure;
smooth_angular_vel = movmean(angular_vel, 10);
%plot(smooth_angular_vel);
figure;
plot(angular_vel)
title("Angular Velocity");
xlabel("Frames");
ylabel("Angular Velocity (Rad/s)");
figure;
subplot(4,1,1)
plot(velocities(:,1),'r');
title("Velocity Graph Against Frames (X-Direction)");
xlabel('Frames');
ylabel('Velocity Pixel/Frame');
subplot(4,1,2)
plot(displacement_x, 'b');
title('Displacement graph against Time (X-Direction)')
xlabel('Frame');
ylabel('Displacement Pixels');
subplot(4,1,3);
plot(velocities(:,2),'r');
title("Velocity Graph Against Frames (Y-Direction)");
xlabel('Frames');
ylabel('Velocity Pixels/Frame');
subplot(4,1,4);
plot(displacement_y,'b')
title('Displacement graph against Time (Y-Direction)')
xlabel('Frames');
ylabel('Displacement Pixels');