EM wave propagation lossy media 3D matlab code

Please help me to write this code in 3-D
t=0:0.001:10;
z=0:0.0005:5;
eta=377;
theta=pi/2;
E0=50;
a=0;
u=1.256*(10.^-6);
e=8.854*(10.^-12);
f=600000000;
w=2*pi*f;
b=w*((u*e).^0.5);
E=E0/eta;
H=E*exp(-a*z).*cos(w*t-b*z-theta);
Ez=E0*exp(-a*z).*cos(w*t-b*z);
figure(1);
subplot(211),plot(z,H,'r');
xlabel('Dispalcement(metres)');
ylabel('Magnetic Field Intensity(H)');
title('Plane wave propagation in Lossy medium');
subplot(212),plot(z,Ez,'g');
xlabel('Dispalcement(metres)');
ylabel('Electric Field Intensity(H)');
title('Plane wave propagation in Lossy medium');

Answers (1)

try this
plot3(z,H,Ez);

2 Comments

Mohammed Aftab
Mohammed Aftab on 15 Jun 2020
Edited: Rik on 16 Jun 2020
Yeah well [], give the code in 3D []
Instead of spewing profanity you could also have tried running this code, at which point you would have noticed that this code is already for the 3D case.

Sign in to comment.

Categories

Find more on Robust Control Toolbox in Help Center and File Exchange

Asked:

on 17 Nov 2017

Commented:

on 5 Jul 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!