先构造Xn与Hn两个函数,ifn>=0&&n<=11x(n)=0.8;elsex(n)=0;endifn>=0&&n<=5h(n)=1;elseh(n)=0;end之后直接用conv函数求卷积就好了。令输出结果为Y,Y=conv(x,h);
y=x1(n)*x2(n)y=conv(x1,x2)