www.gusucode.com > phased 案例源码 matlab代码程序 > phased/ShortDipolePolarizationComponentsExample.m
%% Short-Dipole Polarization Components % Compute the vertical and horizontal polarization components of the field % created by a short-dipole antenna pointed along the _z_-direction. Plot % the components as a function of elevation angle from 0° to 360°. %% % *Note:* This example runs only in R2016b or later. If you are using an earlier % release, replace each call to the function with the equivalent |step| % syntax. For example, replace |myObject(x)| with |step(myObject,x)|. %% % Create the |phased.ShortDipoleAntennaElement| System object(TM). antenna = phased.ShortDipoleAntennaElement(... 'FrequencyRange',[1,2]*1e9,'AxisDirection','Z'); %% % Compute the antenna response. Because the elevation angle % argument to |antenna| is restricted to ±90°, % compute the responses for 0° azimuth and then for 180° azimuth. % Combine the two responses in the plot. The operating frequency of the antenna is % 1.5 GHz. el = [-90:90]; az = zeros(size(el)); fc = 1.5e9; resp = antenna(fc,[az;el]); az = 180.0*ones(size(el)); resp1 = antenna(fc,[az;el]); %% % Overlay the responses in the same figure. figure(1) subplot(121) polar(el*pi/180.0,abs(resp.V.'),'b') hold on polar((el+180)*pi/180.0,abs(resp1.V.'),'b') str = sprintf('%s\n%s','Vertical Polarization','vs Elevation Angle'); title(str) hold off subplot(122) polar(el*pi/180.0,abs(resp.H.'),'b') hold on polar((el+180)*pi/180.0,abs(resp1.H.'),'b') str = sprintf('%s\n%s','Horizontal Polarization','vs Elevation Angle'); title(str) hold off %% % The plot shows that the horizontal component vanishes, as expected.