how to plot the EM wave in matlab

Status
Not open for further replies.

eng_boody

Member level 3
Joined
Nov 27, 2011
Messages
57
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,754
hi

how to plot the EM wave in matlab ....also how to plot phasor phath vs time

thanks
 

Here is planewave:
Code:
[x,y]=meshgrid(5:0.05:15,-5:0.05:5);
lambda=1;
k=2*pi/lambda;
f=3e8/lambda;
w=2*pi*f;
t=linspace(0,60e-9,200);
%z=exp(i*k*abs(x+i*y));
z=exp(i*k*x);
for n=1:length(t)
surf(x,y,real(z*exp(-i*w*t(n))));
%view(ceil(90*n*1/length(t)),ceil(90*n*2/length(t)));
view(3)
zlim([-1.5 1.5])
xlim([min(min(x)) max(max(x))])
ylim([min(min(y)) max(max(y))])
shading interp
getframe();
end
 
Reactions: pewang

    pewang

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…