% Plots the electric field distribution of the lowest order
% TE mode of a parallel plate metallic waveguide

x  =  pi.*( 0.:.05:1.);    % sample points perpedicular to metal
z  =  pi.*(-1.:.05:1.);    % sample points in propagation direction
[Z,X] =  meshgrid (z, x);  
Ey =  sin(X).*sin(0. - Z); % field distribution
%
contour (z, x, Ey)
title  ('Contour plot of TE mode of waveguide')
xlabel ('Propagation distance')
ylabel ('Transverse position')
axis equal
pause
%
pcolor (z, x, Ey)
title  ('False color plot of TE mode of waveguide')
xlabel ('Propagation distance')
ylabel ('Transverse position')
axis equal
shading interp
pause
%
pcolor (z, x, Ey)
title  ('Movie of TE mode of waveguide')
xlabel ('Propagation distance')
ylabel ('Transverse position')
axis equal
shading interp
hold
clear M; % clear video buffer
for j = 1:40
   Ey = [Ey(:,41) Ey(:,1:40)];
   pcolor (z, x, Ey);
   shading interp
   M(j) = getframe;
end
hold
movie(M)
