This repository was archived by the owner on Jan 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcmpPlot.m
More file actions
28 lines (24 loc) · 1.36 KB
/
cmpPlot.m
File metadata and controls
28 lines (24 loc) · 1.36 KB
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
% This function creates a comparison plot between the boom data and the IMU data.
% Note that it will not create a new figure for you, and will leave hold on!
%
% Parameters:
% app An AtriasPostProcess instance with the test's data. Must contain imu_data, boomQ, and boomDQ (in that order) in the controller data (as Mikhail's controller does).
% coord Numeric coordinate. 1 = roll, 2 = yaw, 3 = pitch, 4 = roll rate, 5 = yaw rate, 6 = pitch rate
% boomLs Boom's line style (for plot())
% imuLs IMU's line style (for plot())
%
% Usage examples:
% cmpPlot(AtriasPostProcess(state, time), 1, '.-', '.-r') % Plot the rolls, with line style '.-' for the boom data and '.-r' for the IMU data
% cmpPlot(A, 5, '.-', '.-r') % Using an existing AtriasPostProcess instance, plot the yaw rate with the sameline styles as the previous example
function cmpPlot(app, coord, boomLs, imuLs)
% Pick out the boom data to plot based on the specified coordinate
boomDataOrd = {'RollAngle', 'YawAngle', 'PitchAngle', 'RollVelocity', 'YawVelocity', 'PitchVelocity'};
boomData = app.(['boom' boomDataOrd{coord}]);
% Pick out the imu data to plot based on the specified coordinate
imuData = app.controllerData(:, end-6 + coord);
% Plot the boom data
plot(app.time, boomData, boomLs)
% Plot the IMU data
hold on
plot(app.time, imuData, imuLs)
end