📄 sqmmf.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% sqmmf.m - Generates a normalized square wave mmf and its
% associated Fourier spectrum.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; clf;
% Construct & plot square wave.
n=1024; x=ones(1,n); x(n/2:n)=-x(n/2:n);ang=linspace(0,360,n);
subplot(2,1,1); axis tight; plot(0,1.1,0,-1.1,ang,x); grid;
title('Normalized air gap square wave mmf');
xlabel('Angular position, elect. deg.'); ylabel('mmf/Ni - pu');
% Determine Fourier coefficients & plot in percent.
x=abs(fft(x)); x=x/max(x)*100;
subplot(2,1,2); axis; plot([0:25],x(1:26)); grid;
title('Fourier coefficients of square wave mmf');
xlabel('Harmonic number'); ylabel('Harmonic magnitude, %');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -