%------------------------------------------------------------------------------------------------
% ASSIGNMENT NO : 1
% TITLE : Find the output of given system for given input sequence using linear convolution in MATLAB.
%------------------------------------------------------------------------------------------------
clc
x=[1,1,1,1,1];
h=[1,2,3,4,5];
m=length(x);
n=length(h);
y=zeros(1,m+n-1);
h=[h,zeros(1,m)];
x=[x,zeros(1,n)];
for i=1:m+n-1
y(i)=0;
for j=1:m+n-1
if j<i+1
y(i)=y(i)+x(j)*h((i-j)+1);
end
end
end
y
stem(y);
grid on;