% script rectguide.m
% 
% Plots field distribution of the TE_10 (the dominant) mode in a
% rectangular waveguide, 3/4 by 3/8 wavelengths in size.
x  =  0:.05:1; % 21 samples across guide
z  =  0:.05:2; % 41 samples along guide
[Z,X] = meshgrid (pi.*z,pi.*x);
kg =  sqrt (1 - (2/3).^2);
Ey =  1.5.*sin(X).*cos(Z);
Bx = -kg.*Ey;
Bz =  cos(X).*sin(Z);
pcolor (z, x, Ey)
shading interp
hold on
quiver (z, x, Bz, Bx)
axis equal
hold off



