Graphics Programs Reference
In-Depth Information
rinc = (rmax-rmin)/rticks;
rhodb=zeros(1,length(rho));
for i=1:length(rho)
if rho(i)==0
rhodb(i)=0;
else
rhodb(i)=rmax+2*log10(rho(i))*rinc;
end
if rhodb(i)<=0
rhodb(i)=0;
end
end
% transform data to Cartesian coordinates.
xx = rhodb.*cos(theta);
yy = rhodb.*sin(theta);
% plot data on top of grid
if strcmp(line_style,'auto')
q = plot(xx,yy);
else
q = plot(xx,yy,line_style);
end
if nargout > 0
hpol = q;
end
if ~hold_state
set(gca,'dataaspectratio',[1 1 1]), axis off; set(cax,'NextPlot',next);
end
set(get(gca,'xlabel'),'visible','on')
set(get(gca,'ylabel'),'visible','on')
Listing 8.5. MATLAB Function Ðrect_array.mÑ
function [pattern] =
rect_array(Nxr,Nyr,dolxr,dolyr,theta0,phi0,winid,win,nbits);
%%%%%%%%%% ************************ %%%%%%%%%%
% This function computes the 3-D directive gain patterns for a planar array
% This function uses the fft2 to compute its output
%%%%%%%% ************ INPUTS ************ %%%%%%%%%
% Nxr ==> number of along x-axis; Nyr ==> number of elements along y-
axis
% dolxr ==> element spacing in x-direction; dolyr ==> element spacing in y-
direction Both are in lambda units
% theta0 ==> elevation steering angle in degrees, phi0 ==> azimuth steering
angle in degrees
Search WWH ::




Custom Search