thesis/plot_doubleinput.m

61 lines
1.3 KiB
Matlab
Raw Normal View History

2024-08-31 13:31:35 +02:00
function plot_doubleinput(t, sat, U_track, U_corr, type)
tiledlayout(1,1,'Padding','tight', 'TileSpacing','compact')
nexttile
2024-09-11 15:05:20 +02:00
ylim_ = 7;
lw = 6;
2024-08-31 13:31:35 +02:00
if type == 0
subplot(1,2,1);
else
subplot(2,1,1);
2024-08-31 13:31:35 +02:00
end
hold on
2024-09-11 15:05:20 +02:00
plot(t, U_track(:, 1), 'Linewidth', lw, 'DisplayName', '\omega_r^{track}');
plot(t, U_corr(:, 1), 'Linewidth', lw, 'DisplayName', '\omega_r^{corr}');
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2, 'Color', 'black');
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2, 'Color', 'black');
xlabel('\textbf{t[s]}', 'FontSize', 22, 'Interpreter','latex');
hold off
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
2024-09-11 15:05:20 +02:00
ylim([-ylim_, ylim_])
2024-08-31 13:31:35 +02:00
if type == 0
subplot(1,2,2);
else
subplot(2,1,2);
2024-08-31 13:31:35 +02:00
end
hold on
2024-09-11 15:05:20 +02:00
plot(t, U_track(:, 2), 'Linewidth', lw, 'DisplayName', '\omega_l^{track}');
plot(t, U_corr(:, 2), 'Linewidth', lw, 'DisplayName', '\omega_l^{corr}');
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
plot(t, ones(1,length(t))*sat(1), 'Linewidth', 2, 'Color', 'black');
plot(t, -ones(1,length(t))*sat(1), 'Linewidth', 2, 'Color', 'black');
xlabel('\textbf{t[s]}', 'Interpreter','latex');
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
2024-09-11 15:05:20 +02:00
ylim([-ylim_, ylim_])
hold off
end