微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > Help me plot 3d polar antenna pattern in Matlab

Help me plot 3d polar antenna pattern in Matlab

时间:04-10 整理:3721RD 点击:
Hi, I'm trying to plot 3d polar antenna pattern with matlab, but it doesn't work. The most I can do is to convert data to rectangular coordinates and then use mesh or surf. Obviously it's not the same.
Does anybody know how can I do it (commercial software or private code)?
thanks a lot

Grendhell

There was a bug in my code, now it's working.
Here's the code:

for ii=1:Ntheta
for jj=1:Nphi
x(ii,jj) = D(ii,jj)*sin((ii-1)*dpi)*cos((jj-1)*dpi);
y(ii,jj) = D(ii,jj)*sin((ii-1)*dpi)*sin((jj-1)*dpi);
z(ii,jj) = D(ii,jj)*cos((ii-1)*dpi);
end
end

figure;
surf(x,y,z)
colormap([1 1 1]);
set(gca,'DataAspectRatio',[1 1 1]);
axis equal;

The angles are sampled with a spacing of dpi for a total number of Ntheta along the elevation θ and Nphi along the azimut φ.
Directivity in polar coordinates is stored in D(ii,jj) where rows represents different elevation angles (from 0 to π) and columns different azimuth angle (from 0 to 2π).
The nested for converts from polar to rectangular (there is a built-in function in Matlab, but the coordinates are different) and then the date are plotted via surf function (mesh and similar might be used as well).
Hope this will help.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top