3D pattern plotting function seems to be wrong !

3 ビュー (過去 30 日間)
Krishan Kumar Tiwari
Krishan Kumar Tiwari 2023 年 10 月 21 日
編集済み: Krishan Kumar Tiwari 2023 年 11 月 25 日
I wrote the following function for plotting 3D pattern of an array with position vectors in a matrix named ``RIS'' and the beamforming weights in W, there seems to be an error which I am unable to locate, any comments ?
function [G] = Full_3D_Pattern (W, RIS)
theta = -pi/2 : pi/2e2 : pi/2; phi = theta; %angle steps of 1 degree for plotting
G = zeros ( length(theta), length(phi) );
A = zeros ( length(W), length(theta), length(phi) );
for k = 1:length(phi)
for tta = 1:length(theta)
ux = cos(phi(k))*sin(theta(tta));
uy = cos(phi(k))*cos(theta(tta));
uz = sin (phi(k));
u = [ux; uy; uz];
A (:,tta,k) = exp (-1i*pi*u'*RIS); % RIS steering vector for tta, k
G (tta,k) = abs(W' * A (:,tta,k)) * cos(theta(tta))*cos(phi(k)) * 2;
end
end
figure('Name','3D Pattern')
set(0,'DefaultAxesFontSize',20,'DefaultTextFontSize',20);
mesh(theta,phi,abs(G).^2);xlim([-pi/2 pi/2]);ylim([-pi/2 pi/2]); %%%% radian space
xlabel('Phi','FontSize',22); ylabel('Theta','FontSize',22); colorbar
end
  6 件のコメント
Krishan Kumar Tiwari
Krishan Kumar Tiwari 2023 年 10 月 22 日
編集済み: Krishan Kumar Tiwari 2023 年 10 月 22 日
Yes, there is a problem, if you give el = az = 0, then you get a fan / blade beam, when you steer it, it gets curved -- just steering causes the curvature -- it should not !!
Krishan Kumar Tiwari
Krishan Kumar Tiwari 2023 年 10 月 22 日
For el = az = 0, use W = ones (320,1), sorry i should have written it earlier .

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by