作业帮 > 综合 > 作业

为什么用MATLAB显示空白?

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/30 02:20:15
为什么用MATLAB显示空白?
clf;
w=-pi:2*pi/255: pi;
x1=[1 3 5 7 9 11 13 15 17];
x2=[1 -2 3 -2 1];
y=conv(x1,x2);
h1=freqz(x1,1,w);
h2=freqz(x2,1,w);
hp=hi.*h2;
h3=freqz(y,1,w);
subplot(2,2,1)
plot(w/pi,abs (hp));grid
title(‘幅度谱的乘积’)
subplot(2,2,2)
plot(w/pi,abs (h3));grid
title(‘卷积后序列的幅度谱’)
subplot(2,2,3)
plot(w/pi,angle (hp));grid
title(‘相位谱的和’)
subplot(2,2,4)
plot(w/pi,angle (h3));grid
title(‘卷积后序列的相位谱’)
%  hp=hi.*h2;        改成     hp = h1.*h2;
% title(‘幅度谱的乘积’)     将引号全部改成半角符号
clf;        w=-pi:2*pi/255: pi;        x1=[1 3 5 7 9 11 13 15 17];        x2=[1 -2 3 -2 1];        y=conv(x1,x2);        h1=freqz(x1,1,w);        h2=freqz(x2,1,w);        hp=h1.*h2;        h3=freqz(y,1,w);        subplot(2,2,1)plot(w/pi,abs (hp));gridtitle('幅度谱的乘积')subplot(2,2,2)plot(w/pi,abs (h3));gridtitle('卷积后序列的幅度谱')subplot(2,2,3)plot(w/pi,angle (hp));gridtitle('相位谱的和')subplot(2,2,4)plot(w/pi,angle (h3));gridtitle('卷积后序列的相位谱')