media.m
来自「自由空间E和H场的相位差和振幅衰落」· M 代码 · 共 41 行
M
41 行
clear all% Parameters for different media% free space: kr=1, ki=1, phi=0% plasma medium: kr=0, ki=1, phi=pi/2% very lossy medium: kr=1, ki=1, phi=pi/4kr = 1*1;ki = 1*1;phi = 1*pi/4;xmax = 15;xmin = -4;delx = 0.1;x = [ 0:delx:xmax];x2 = [xmin:delx:xmax];framemax = 48;M = moviein(framemax);set(gcf,'Position',[100 100 640 480])for n=1:framemaxE = exp(-0.3.*x.*ki).*cos(kr.*x-2*pi*n/framemax );H = exp(-0.3.*x.*ki).*cos(kr.*x-2*pi*n/framemax+phi);S = E.*H;figure(1)whitebg([1 1 1]);plot(x, E ,'r' ,'LineWidth',5);hold onplot(x-round(100*H)/30,-H,'b' ,'LineWidth',3);plot(x, S ,'g' ,'LineWidth',3);legend('E-field','H-field','Power density')plot( x2, 0*x2,'k','LineWidth',3);plot( x2, 0.3*x2,'k','LineWidth',3);plot(0*x2, x2,'k','LineWidth',3);hold offaxis([-4 10 -1.1 1.5])title('Wave Propagation in Very Lossy Media','fontsize',18)M(:,n) = getframe(gcf);endclf resetset(gcf,'Position',[100 100 800 600])axis offmovie(M,3,1)close all
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?