www.gusucode.com > phased 案例源码 matlab代码程序 > phased/FindLobesSteeredIsotropicAntennaULAPatternsExample.m

    %% Find Lobes of Steered Isotropic Antenna ULA Patterns
% Create a 15-element ULA of isotropic antenna with elements spaced
% one-half wavelength apart. Plot the directivity of the array at 20 GHz.
% Then steer the array to 45° azimuth and plot the directivity.
% Then, find the mainlobe, sidelobe, and backlobe directions of the array
% pattern.
fc = 20.0e9;
c = physconst('Lightspeed');
lam = c/fc;
angs = [-180:1:180];
antenna = phased.IsotropicAntennaElement('FrequencyRange',[1.0e9,100.0e9]);
array = phased.ULA('Element',antenna,'NumElements',15,'ElementSpacing',lam/2);
a = pattern(array,fc,angs,0);
P = polarpattern(angs,a);
%%
% Steer the array to 45&deg azimuth and add the steered pattern to the
% polar plot.
steervec = phased.SteeringVector('SensorArray',array,'PropagationSpeed',c);
sv = steervec(fc,[45;0]);
a1 = pattern(array,fc,angs,0,'Weights',sv);
add(P,angs,a1);
%%
% Find the lobes of the steered pattern.
L = findLobes(P,2);
L.mainLobe