%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Thank you for using ClarkWare Products!!!! % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % RADPAT Radiation Pattern plotter. % RADPAT (Degree, dBi, linetype) plots the radiation pattern in dBi % with respect to the degrees in Degree, using the standard linetype % The plot is limited, as usual to -40 dBi as per my PLOT package. % See Also ClarkWare for a description of other products! % Alan Robert Clark, PrEng. % Dept Elec Eng % P.O.Wits % 2050 South Africa % clark@odie.wits.ee.ac.za % 30 December 1992. function radpat (degree, dBi, linetype); % turn the degrees into radians.. degree = degree.*pi./180; % limit the dBi to a min of -30dBi (as my PLOT package) dBi = dBi+40; for i = 1:length(dBi) if dBi(i) < 0 dBi(i) = 0; end; end; axis ([-50,50,-50,50]); hold on; % get the grid on -- note the polar form of GRID has a rather serious % bug -- if the plot comes out in between the last two circles, GRID % produces SQUARE grids with rounded corners!!!! circdeg = 0:0.1:2.1*pi; circ=ones(circdeg); for i = 1:5 polar (circdeg, circ.*10*i, 'w:'); end; for i=0:12 polar ([0,i*pi/6],[0,50],'w:'); end; clear circdeg; clear circ; % Go ahead and plot the radpat. polar (degree, dBi, linetype); % Do a bit of fiddling to get the scale positioned.. text (0,50,'10 dBi'); text (0,40,'0'); text (0,30,'-10'); text (0,20,'-20'); text (0,10,'-30'); text (pi/2+0.05,55,'90'); text (-pi,60,'180'); text (-pi/2-0.05,55,'270'); hold off % return to usual state axis; % Return axis to autoranging state % Need to address a serious bug in the reversion to rectangular coords % .. if the plot is held, and PLOT is used, the FIRST point is haywire-- % causing GPP to hang the machine etc. SECOND point is fine. % Hence : hold on; plot(0,0,'i'); hold off; % which sorts it out beautifully.....