% Exemplo 15.17
clear all
close all
clc

t = 0:0.05:5;
for i = 1:length(t)
% a)
    y_a(i) = 1-exp(-t(i))-t(i)*exp(-t(i));
% b)
    y_b(i) = 1-exp(-t(i))+(1-exp(1))*t(i)*exp(-t(i));
end

figure
plot(t,y_a,'b','LineWidth',2)
hold on
plot(t,y_b,'r','LineWidth',2)
grid on
axis([0 5 -0.2 1.2])
legend('a)','b)','Location','SouthEast')
xlabel('t')
ylabel('y(t)')
title('Respostas temporais do Ex. 15.17')

