www.gusucode.com > phased 案例源码 matlab代码程序 > phased/DirectivityPartitionedArrayExample.m
%% Directivity of Partitioned Array % Compute the directivity of a partitioned array formed from a single % 20-element ULA with elements spaced one-quarter wavelength apart. The % subarrays are then phase-steered towards 30 degrees azimuth. The % directivities are computed at azimuth angles from 0 to 60 degrees. % Copyright 2015 The MathWorks, Inc. c = physconst('LightSpeed'); fc = 3e8; lambda = c/fc; angsteer = [30;0]; ang = [0:10:60;0,0,0,0,0,0,0]; %% % Create a partitioned ULA array using the |SubarraySelection| property. myArray = phased.PartitionedArray('Array',... phased.ULA(20,lambda/4),'SubarraySelection',... [ones(1,10) zeros(1,10);zeros(1,10) ones(1,10)],... 'SubarraySteering','Phase','PhaseShifterFrequency',fc); %% % Create the steering vector and compute the directivity. myStv = phased.SteeringVector('SensorArray',myArray,... 'PropagationSpeed',c); d = directivity(myArray,fc,ang,'PropagationSpeed',c,'Weights',... step(myStv,fc,angsteer),'SteerAngle',angsteer)