clc
clear 
close all


sim('Ex11_3_5_sim');
time = time-1;
figure(1)
title('Simulation of responses')
subplot(411)
plot(time,ys,'black')
xlim([-2, 51]);
ylim([-0.1, 1.1]);
ylabel('y_s', 'Interpreter','tex')
subplot(412)
plot(time,y,'Displayname', '\tau_c = 1')
hold on;
plot(time,y2,'--', 'Displayname', '\tau_c = 3')
ylabel('y', 'Interpreter','tex')
legend('Interpreter','tex')
hold off;
xlim([-2, 51]);
subplot(413)
plot(time,u)
hold on;
plot(time,u2, '--')
ylabel('u', 'Interpreter','tex')
hold off;
xlim([-2, 51]);
subplot(414)
plot(time,d,'black')
xlim([-2, 51]);
ylim([-0.1, 1.1]);
xlabel('Time [s]')
ylabel('d', 'Interpreter','tex')
set(gcf,'Position',[100 100 800 800]) 
saveas(figure(1), 'Simulation', 'jpg')
