-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_tripleinput.m
More file actions
66 lines (49 loc) · 1.78 KB
/
plot_tripleinput.m
File metadata and controls
66 lines (49 loc) · 1.78 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function plot_tripleinput(t, sat, U, U_track, U_corr, type, in1, in2, m1, m2)
%tiledlayout(1,1,'Padding','tight', 'TileSpacing','compact')
%nexttile
ylim1_ = sat(1)*2.5;
ylim2_ = sat(2)*2.5;
lw = 6;
if type == 0
subplot(1,2,1);
else
subplot(2,1,1);
end
hold on
plot(t, U_track(:, 1), 'Linewidth', lw-1, 'DisplayName', [in1 '^{track}'], 'Color', 'cyan');
plot(t, U_corr(:, 1), 'Linewidth', lw-1, 'DisplayName', [in1 '^{corr}'], 'Color', 'green');
plot(t, U(:, 1), 'Linewidth', lw, 'DisplayName', in1, 'Color', 'red');
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
xlabel('\textbf{t[s]}', 'Interpreter','latex');
ylabel(['\textbf{[', m1 ']}'], 'Interpreter','latex');
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--', 'Color', 'black');
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--', 'Color', 'black');
hold off
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
ylim([-ylim1_, ylim1_])
if type == 0
subplot(1,2,2);
else
subplot(2,1,2);
end
hold on
plot(t, U_track(:, 2), 'Linewidth', lw-1, 'DisplayName', [in2 '^{track}'], 'Color', 'cyan');
plot(t, U_corr(:, 2), 'Linewidth', lw-1, 'DisplayName', [in2 '^{corr}'], 'Color', 'green');
plot(t, U(:, 2), 'Linewidth', lw, 'DisplayName', in2, 'Color', 'red');
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
xlabel('\textbf{t[s]}', 'Interpreter','latex');
ylabel(['\textbf{[', m2 ']}'], 'Interpreter','latex');
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--', 'Color', 'black');
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2.5, 'LineStyle', '--', 'Color', 'black');
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
ylim([-ylim2_, ylim2_])
hold off
end