MATLAB: Not able to plot output of covolution

duplicate postnot able to plot output of covolution

step=0.01 th=0:step:10
th1=0:step:1 th2=1+step:step:2 th3=2+step:step:10 th=[th1 th2 th3] x1=zeros(size(th1)) x2=ones(size(th2)) x3=zeros(size(th3)) x=[x1 x2 x3] m=0:step:10 m1=0+step:step:1 m2=1+step:step:2 m3=2+step:step:10 m=[m1 m2 m3] y1=zeros(size(m1)) y2=ones(size(m2)) y3=zeros(size(m3)) y=[y1 y2 y3] k=conv(x,y)*step ty=0:step:20 plot(ty,k)

Best Answer

Like I said in your duplicate question, try the 'same' option in conv().
k = conv(x,y, 'same') * step;