clear all
clc
twpi = 2*pi;
rad = pi/180;
deg = 180/pi;
Angle_range = 50;
Search_step = 1;
c = 3e8;
snr = 20;
Center_Frequency = 6e9;
lamda = c/Center_Frequency;
Noise_Power = 2;
Sample_frequency = 1e9;
Sample_Number = 200;
Sample_Index = [0:Sample_Number-1];
Signal_Amplitude = sqrt(2*Noise_Power*10^(snr/10));
Array_Frequency1 = Center_Frequency;
S0 = exp(1j*2*pi*Array_Frequency1/Sample_frequency*Sample_Index);
beishu = 3.18;
R_6G = 0.05*beishu;
kelm = 9;
Location_Y = [];
Location_Z = [];
for i = 1:kelm
m = i-1;
Location_y = R_6G*cos(twpi*m/kelm);
Location_z = R_6G*sin(twpi*m/kelm);
Location_Y = [Location_Y;Location_y];
Location_Z = [Location_Z;Location_z];
end
Location = [Location_Y,Location_Z];
figure(1);
scatter(Location(:,1),Location(:,2))
xlabel('Z');
ylabel('Y');
grid;
title('阵元分布图')
xlim([-0.5,0.5])
ylim([-0.5,0.5])
r_theta = 90*ones(1,kelm)*rad;
r_phi = (0:360/kelm:360/kelm*(kelm-1))*rad;
r_b =