function [a,b,m,sum] =convsamp( h )
m=0:h; a=[0,(0:h)]; %unit ramp sequence
b=[0,ones(1,h)]; %unit step sequence
sum =(h+h)-1; for i=0:(h+h)-1 y(i)=0; for j=0:h if(i-j+1>0) y(i)=y(i)+a(j)*h(i-j+1); end end endsubplot(3,1,1), stem (m,b), %plots the step signal
title('Unit Step Sequence');subplot(3,1,2),stem(m,a), %plots the ramp signal
title('Unit Ramp Sequence');
—i used this code but there seems to be a problem in line 6 y(i)=0; can you please help me
Best Answer