squarepixel_ebxn_1d_fc.m

来自「通过计算晶体结构来确定其光谱分布」· M 代码 · 共 18 行

M
18
字号
function ret=SquarePixel_ebxn_1D_FC(ebxn,pw,m)
%return Fourier Coefficients of 1D ebxn with Square pixels
%ebxn=the first quadrant in permittivity 
%pw=pixel width
%m=orders index of Fourier coefficient along z axis
t=size(ebxn);
M=max(t);
cw=2*M*pw;
t0=2*pw/cw;
mt=pi*m*pw/cw;
if mt==0
    sm=1;
else
    sm=sin(mt)/mt;
end
ret=t0*sum(ebxn.*cos(mt*(2*(1:M)-1)))*sm;

        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?