clear all x=[0 0 2 4 5 -3 0 ] x_=x; h=[1 2 1 3 -1 4]; h_=h; m=zeros(length(x)+length(h)-1); for i=1:length(h) for j=1:length(x) m(i,j)=x(j) end x=[0 x] end for i=1:length(h) k(i,:)=h(i)*m(i,:) end sum(k) subplot(3,1,1) stem(x_) grid on subplot(3,1,2) stem(h_) grid on subplot(3,1,3) stem(sum(k)) grid on