forked from ShiauweiZhao/plotulog
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotSensorData.m
More file actions
26 lines (25 loc) · 869 Bytes
/
plotSensorData.m
File metadata and controls
26 lines (25 loc) · 869 Bytes
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
function plotSensorData(time, gyro_xyz, accel_xyz, path)
h_sens = figure('Position',[50,700,600,400]);
clf(h_sens);
subplot(211)
plot(time, gyro_xyz(:,1));
grid on;
xlim( [ time(1) time(length(time)) ]);
set (gca, 'xminorgrid', 'on'); xlabel('Time(sec)'); ylabel('Gyro (rad/s)'); title('Raw Angular speed');
hold on;
plot(time, gyro_xyz(:,2));
plot(time, gyro_xyz(:,3));
legend('X', 'Y', 'Z');
hold off;
subplot(212)
plot(time, accel_xyz(:,1));
grid on;
xlim( [ time(1) time(length(time)) ]);
set (gca, 'xminorgrid', 'on'); xlabel('Time(sec)'); ylabel('Acceleration (m/s^2)'); title('Raw Acceleration');
hold on;
plot(time, accel_xyz(:,2));
plot(time, accel_xyz(:,3));
legend('X', 'Y', 'Z');
hold off;
saveName = sprintf('%sSensor_Data.png', path)
saveas(h_sens,saveName);