作业帮 > 综合 > 作业

matlab 2012a报错

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/23 10:03:43
matlab 2012a报错
ft=sym('sin(pi*t)/(pi*t)');
Fw=fourier(ft);
subplot(211)
ezplot(abs(Fw)),grid on
title('幅度谱')
phase=atan(imag(Fw)/real(Fw));
subplot(212)
ezplot(phase);grid on
title('相位谱')
打错了
ft=sym('sin(pi*t)/(pi*t)^2');
Fw=fourier(ft);
subplot(211)
ezplot(abs(Fw)),grid on
title('幅度谱')
phase=atan(imag(Fw)/real(Fw));
subplot(212)
ezplot(phase);grid on
title('相位谱')
ft=sym('sin(pi*t)/(pi*t)');
Fw=fourier(ft);
subplot(211)
ezplot(abs(Fw))
grid on
title('幅度谱')
phase=atan(imag(Fw)/real(Fw));
subplot(212)
ezplot(phase);
grid on
title('相位谱') %打错了
ft=sym('sin(pi*t)/(pi*t)^2');
Fw=fourier(ft);
subplot(211)
ezplot(abs(Fw))
grid on
title('幅度谱')
phase=atan(imag(Fw)/real(Fw));
subplot(212)
ezplot(phase);
grid on
title('相位谱')

望采纳
再问: 抱歉,没看出差别在哪。。。
再答: 你想画波形的幅度和相位谱?你的程序我不太理解
再问: 恩,是想绘出幅度和相位谱
再答: 懂了 改为 ft=sym('sin(pi*t)/(pi*t)^2'); Fw=fourier(ft); subplot(211) ezplot('abs(Fw)') grid on title('幅度谱') phase=atan(imag(Fw)/real(Fw)); subplot(212) ezplot('phase'); grid on title('相位谱') 望采纳