thesis/plot_tripleinput.m

66 lines
1.8 KiB
Matlab
Raw Normal View History

function plot_tripleinput(t, sat, U, U_track, U_corr, type, in1, in2, m1, m2)
2024-09-11 15:05:20 +02:00
%tiledlayout(1,1,'Padding','tight', 'TileSpacing','compact')
%nexttile
ylim1_ = sat(1)*2.5;
ylim2_ = sat(2)*2.5;
2024-09-11 15:05:20 +02:00
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
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');
2024-09-11 15:05:20 +02:00
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
xlabel('\textbf{t[s]}', 'Interpreter','latex');
ylabel(['\textbf{[', m1 ']}'], 'Interpreter','latex');
2024-09-11 15:05:20 +02:00
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');
2024-09-11 15:05:20 +02:00
hold off
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
ylim([-ylim1_, ylim1_])
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
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');
2024-09-11 15:05:20 +02:00
legend('FontSize', 18, 'Location', 'northeast', 'AutoUpdate','off')
xlabel('\textbf{t[s]}', 'Interpreter','latex');
ylabel(['\textbf{[', m2 ']}'], 'Interpreter','latex');
2024-09-11 15:05:20 +02:00
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');
2024-09-11 15:05:20 +02:00
Axes = gca;
Axes.FontSize=22;
Axes.FontWeight='bold';
grid minor;
Axes.PlotBoxAspectRatio = [1 1 1];
ylim([-ylim2_, ylim2_])
hold off
end