% Script for Problem 2.5
disp('Solution to Problem 2.5')

t=0:0.1:10;

% Response due to U1(s)
n1=[16];
d1=conv([1 1],[1 6 16]);
y1=impulse(n1,d1,t);

% Response due to U2(t)
n2=[16 32];
d2=conv([1 0],[1 6 16]);
y2=impulse(n2,d2,t);

% Response due to U1(s) and U2(s) [y(t)=y1(t)+y2(t)]
n=16*[1 4 2];
d=conv(conv([1 0],[1 1]),[1 6 16]);
%y=impulse(n,d,t);
y=y1+y2;

plot(t,y1,':',t,y2,'--',t,y)
grid
xlabel('time [s]')
ylabel('y1, y2, y')
[xy,yy]=ginput;
text(xy,yy,'y1')
[xy,yy]=ginput;
text(xy,yy,'y2')
[xy,yy]=ginput;
text(xy,yy,'y')
