Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- clc;
- close all
- k=2*pi; %spatial propgation constant
- w=10; %angular frqency
- Eym=20*sqrt(2); %electric field amplitude
- Hzm=15*sqrt(2); %magnetic field amplitude
- t=0:0.001:10;
- x=0:0.0005:5;
- Zo1=zeros(size(x));
- Ey=Eym*cos(w*t-k*x);
- Hz=Hzm*cos(w*t-k*x);
- Eyw=Eym*cos(w*t-k*x).*exp(-0.5*x);
- Hzw=Hzm*cos(w*t-k*x).*exp(-0.5*x);
- subplot(1,2,1)
- figure(1)
- plot3(x,Ey,Zo1,'b');
- hold on;
- plot3(x,Zo1,Hz,'r');
- grid on;
- axis([0,5,min(Ey(:)),max(Ey(:)),min(Hz(:)),max(Hz(:))])
- xlabel('x axis');ylabel('electric field');zlabel('magnetic filed');
- set(gcf,'color','w');
- subplot(1,2,2)
- figure(1)
- plot3(x,Eyw,Zo1,'b');
- hold on;
- plot3(x,Zo1,Hzw,'r');
- grid on;
- axis([0,5,min(Eyw(:)),max(Eyw(:)),min(Hzw(:)),max(Hzw(:))])
- xlabel('x axis');ylabel('electric field');zlabel('magnetic filed');
- set(gcf,'color','w');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement