squarepixel_ebxn_1d_fc.asv

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

ASV
25
字号
function ret=SquarePixel_ebxn_1D_FC(ebxn,pw,m,flag)
%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
%flag=1: ;
%flag=2: ;
t=size(ebxn);
if min(t)~=1
    ret=-1;
    disp('ebxn is not one dimension');
    return;
end
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 + -
显示快捷键?