📄 face_direction_pic.m
字号:
clear;close all;clc;
f=2e6;c=3e8;lamda=c/f;d=0.5*lamda;
N=64;
%--------------------------产生坐标-----------------------------%
x=[0 d 2*d 3*d 4*d 5*d 6*d 7*d];y=x;
[X,Y]=meshgrid(x,y);
X=X';Y=Y';
X=reshape(X,1,N);Y=reshape(Y,1,N);
D=[X;Y];
%--------------------------theta 方位,fai俯仰------------%
theta0=60*pi/180;fai0=60*pi/180;
%--------------------------产生导向矢量--------------------------%
k0=[cos(theta0)*cos(fai0) sin(theta0)*cos(fai0)];
atheta0=exp(j*2*pi*k0*D/lamda).';
%-----------------------------------------------------------------%
p=0;
for theta=(-90:1:90)*pi/180;
p=p+1;
q=0;
for fai=(0:1:90)*pi/180 ;
q=q+1;
k=[cos(theta)*cos(fai) sin(theta)*cos(fai)];
atheta=exp(j*2*pi*k*D/lamda).' ;
A(p,q)=atheta0'*atheta;
end
end
C=max(max(abs(A)));
theta=-90:1:90;
fai=0:1:90;
mesh(fai,theta,abs(A)/C);
grid on;
figure
contour(fai,theta,abs(A)/C);
xlabel('俯仰')
ylabel('方位')
title('面阵方向图')
hold on;plot(fai0*180/pi,[-90:90],'r');
hold on;plot([0:90],theta0*180/pi,'r');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -