program_11_4.m
来自「介绍matlab编程的经典著作,包括与VC++进行联合编程,还包括一些经典的算法」· M 代码 · 共 12 行
M
12 行
% Program 11_10
% Spectral Analysis Using the DFT
%
N = input('Type in the length of DFT = ');
T = input('Type in the sampling period = ');
freq = input('Type in the frequency of the sinusoid -= ');
k = 0:N-1;
f = sin(2*pi*freq*k*T);
F = fft(f);
stem(k,abs(F));grid
xlabel('k');
ylabel('|X[k]|');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?