필터 지우기
필터 지우기

Antenna plot in 3D

조회 수: 6 (최근 30일)
Tadej
Tadej 2011년 9월 20일
답변: Vishwanath Iyer 2021년 6월 3일
Can someone know what is wrong in my code? I adjust values (C,D,E,Ep,JpI) according the size [360x180] of matrices PHI and THETA. My task is to draw R (in may case this is array factor) in 3D space.
My code:
clear all;
close all
dbstop if error
V1=0; A1=0; C=0;
V2=0; A2=0; D=0;
V3=0; A3=0; E=0;
Ep=0; AnI=0; JpI=0;
R=0;
% number of elements N, wavenumber B
N = 3; %Number of elemnts in array
B = 0.14; %B =(2*pi/lambda), wavenumber
% Magnitude, Phase, X,Y,Z coordinate
An = [2 2 2]; %Magnitude of 1st, 2nd and 3rd,...Nth element
Jp = [120 90 60]; %Phase of 1st, 2nd and 3rd,...Nth element
Xn = [1 2 3]; % Position of 1st, 2nd and 3rd,...Nth element on X-axis
Yn = [1 2 3]; % Position of 1st, 2nd and 3rd,...Nth element on Y-axis
Zn = [1 2 3]; % Position of 1st, 2nd and 3rd,...Nth element on Z-axis
%Azimut--> 0<Phi<360, Elevation--> 0<Theta<180
Phi = (1:1:360)*pi/180; %azimuth
Theta = (1:1:180)*pi/180; %elevation
[THETA,PHI] = meshgrid(Theta,Phi);
% calculate the array factor
%size(THETA)
%length(THETA)
%convert vector [1x3] into matrix [360x180] C = Xn .* sin(THETA) .* cos(PHI);
V1 = repmat(Xn,360,60);
A1 = sin(THETA) .* cos(PHI);
C = A1.*V1;
%convert vector [1x3] into matrix [360x180] D = Yn * sin(THETA) * sin(PHI);
V2 = repmat(Yn,360,60);
A2 = sin(THETA) .* sin(PHI);
D = A2.*V2;
%convert vector [1x3] into matrix [360x180] E = Zn * cos(THETA);
V3 = repmat(Zn,360,60);
A3 = cos(THETA);
E = A3.*V3;
Ep = B.*(C+D+E);
%convert degree into radian
Jp = (Jp.*pi)/180;
%sum velues in vector An, convert vector Jp [1x3] into matrix [360x180]
AnI = sum(An);
JpI = repmat(Jp,360,60);
R = AnI.*exp(1i.*(Ep + JpI)); %Equation for array factor
%h(PHI, THETA) = R;
%AF(PHI, THETA) = abs(h(PHI, THETA));
%plot the array factor
X = R.*sin(THETA).*cos(PHI);
Y = R.*sin(THETA).*sin(PHI);
Z = R.*cos(THETA);
figure();
mesh(X,Y,Z); %display
surf(X,Y,Z) %colored faces
title('Polar plot in 3D space')
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
Best regards, Tadej

채택된 답변

Tadej
Tadej 2011년 9월 20일
I have found out. R has a complex values, so I just add R = abs®;
Greetings, Tadej

추가 답변 (1개)

Vishwanath Iyer
Vishwanath Iyer 2021년 6월 3일
Use the following documentation page and examples to learn about the use of arrayFactor in Antenna Toolbox

카테고리

Help CenterFile Exchange에서 Array Geometries and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by