57 lines
1.2 KiB
Matlab
57 lines
1.2 KiB
Matlab
function plot_input(t, sat, U, orient, type, in1, in2, m1, m2)
|
|
|
|
|
|
tiledlayout(1,1,'Padding','tight', 'TileSpacing','compact')
|
|
nexttile
|
|
|
|
if orient == 0
|
|
subplot(1,2,1);
|
|
else
|
|
subplot(2,1,1);
|
|
end
|
|
|
|
ylim1_ = sat(1)*2.5;
|
|
ylim2_ = sat(2)*2.5;
|
|
|
|
hold on
|
|
plot(t, U(:, 1), 'Linewidth', 6);
|
|
|
|
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');
|
|
|
|
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
|
ylabel(['\textbf{$$' in1 '^{' type '}$$ [' m1 ']}'], 'Interpreter','latex');
|
|
hold off
|
|
|
|
|
|
Axes = gca;
|
|
Axes.FontSize=26;
|
|
Axes.FontWeight='bold';
|
|
grid minor;
|
|
Axes.PlotBoxAspectRatio = [1 1 1];
|
|
ylim([-ylim1_, ylim1_])
|
|
|
|
if orient == 0
|
|
subplot(1,2,2);
|
|
else
|
|
subplot(2,1,2);
|
|
end
|
|
|
|
hold on
|
|
plot(t, U(:, 2), 'Linewidth', 6);
|
|
|
|
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');
|
|
|
|
xlabel('\textbf{t[s]}', 'Interpreter','latex');
|
|
ylabel(['\textbf{$$' in2 '^{' type '}$$ [' m2 ']}'], 'Interpreter','latex');
|
|
hold off
|
|
|
|
Axes = gca;
|
|
Axes.FontSize=26;
|
|
Axes.FontWeight='bold';
|
|
grid minor;
|
|
Axes.PlotBoxAspectRatio = [1 1 1];
|
|
ylim([-ylim2_, ylim2_])
|
|
|
|
end |