Help me plot 3d polar antenna pattern in Matlab
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.
