Graphics Programs Reference
In-Depth Information
hvkrho = besselh(v,2,krho);
jvk1rho = besselj(v,k1rho);
djvkrho = dbesselj(v,krho);
djvk1rho = dbesselj(v,k1rho);
dhvkrho = dbesselh(v,2,krho);
ssterm = sin(v*(phip-alpha))*sin(v*(phiij-alpha));
scterm = sin(v*(phip-alpha))*cos(v*(phiij-alpha));
if rhoij <= ar % field point location is inside the cap region
Ezt = a(m)*jvk1rho*ssterm;
Hphit = k1*a(m)*djvk1rho*ssterm;
Hrhot = v*a(m)*jvk1rho*scterm/rhoij;
else % field point location is between the cap and the line source location
Ezt = (b(m)*jvkrho+c(m)*hvkrho)*ssterm;
Hphit = k*(b(m)*djvkrho+c(m)*dhvkrho)*ssterm;
Hrhot = v*(b(m)*jvkrho+c(m)*hvkrho)*scterm/rhoij;
end
else
Ezt = 0; Hrhot = 0; Hphit = 0; % inside wedge region
End
Listing 11.15. MATLAB Function "polardb.m"
function polardb(theta,rho,line_style)
% POLARDB Polar coordinate plot.
% POLARDB(THETA, RHO) makes a plot using polar coordinates of
% the angle THETA, in radians, versus the radius RHO in dB.
% The maximum value of RHO should not exceed 1. It should not be
% normalized, however (i.e., its max. value may be less than 1).
% POLAR(THETA,RHO,S) uses the linestyle specified in string S.
% See PLOT for a description of legal linestyles.
if nargin < 1
error('Requires 2 or 3 input arguments.')
elseif nargin == 2
if isstr(rho)
line_style = rho;
rho = theta;
[mr,nr] = size(rho);
if mr == 1
theta = 1:nr;
else
th = (1:mr)';
theta = th(:,ones(1,nr));
end
else
Search WWH ::




Custom Search