请问这个函数怎么用matlab画频谱图,需要详细程序,感谢答:clc;clear allf=100;omega=2*pi*f;T0=0.005;Tmax=0.05;t=linspace(0,Tmax,1024*8);x=cos(omega*t).*(t<T0)+0*(t>=T0);subplot(1,2,1)plot(t,x)fs=100;N=length(x);n=0:N-1;t=n/fs;y=fft(x,N);mag=abs(y);f=n*fs/N;subplot(1,2,2)plot(f,mag,'r')