clc
syms t w A
syms tao positive
%yt=heaviside(t+tao/2)-heaviside(t+tao/2)
%我猜你是想生成一个窗口函数吧,所以后面一项应该是减,不然yt一直为零
yt=heaviside(t+tao/2)-heaviside(t-tao/2)
Yw=fourier(A*yt,t,w)
yt3=subs(yt,tao,3)
Yw3=subs(Yw,[A,tao],[1,3])
subplot(2,1,1)
%Ht=ezplot(yt3,[-3.3]);
%这里是想指定范围吧,所以应该是[-3,3]
Ht=ezplot(yt3,[-3,3]);
set(Ht,'Color','r','LineWidth',3)
%subplot(2,1,2),ezplot(Yw)
%这里是想搞傅里叶变换的频谱吧,所以应该为Yw3
subplot(2,1,2),ezplot(Yw3)
%结果如插图