replotting radiation pattern from its txt form

Hello ,I have as simple patch antenna with a radiation pattern shown in the attached photo.
i have its TXT form in the attached txt file called "data_rad.txt"
how can i recreate this plot from the TXT file in matlab.
Thanks

댓글 수: 2

ali
ali 2017년 12월 8일
hi did you find the solution ?? I need help too :)
Try the patternCustom function in Antenna Toolbox
https://in.mathworks.com/help/antenna/ref/patterncustom.html

댓글을 달려면 로그인하십시오.

답변 (1개)

Mathieu NOE
Mathieu NOE 3분 전

0 개 추천

hello
maybe this ? nothing fancy but I just figure out your reference image and the usual elevation angle convention (which is the one used in matlab function sph2cart) differs by a shift of pi/2.
the sphere radius is supposed to be 1 (no data found on this matter).
if you want a smooth sphere plot without the edges see fig 3
filename = "data_rad.txt ";
data = readmatrix(filename,'NumHeaderLines',2); % or readtable or whatever you prefer
% Theta [deg.] Phi [deg.] Abs(Dir.)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
theta = data(:,1)*pi/180; % elevation in radians
theta = pi/2-theta; % /!\ onvention change (from image convention to usual elevation angle convention ,also as per matlab fn)
phi = data(:,2)*pi/180; % azimuth in radians
Ad = data(:,3); % Abs(Dir.)[dBi]
% Convert to Cartesian coordinates
[x, y, z] = sph2cart(phi, theta, 1); % (azimuth TH, elevation PHI, radius R)
figure(1)
scatter3(x,y,z,20,Ad,'filled');
xlabel('X')
ylabel('Y')
zlabel('Z')
axis equal
colormap('jet');
colorbar
figure(2)
tri = convhull([x y z]); % triangle connectivity matrix (could be also
% obtained with delaunay) - but since it's a sphere, I think convhull is better suited.
% tri = delaunay([x y z]); % triangle connectivity matrix (could be also obtained with delaunay)
trisurf(tri,x,y,z,Ad,'facecolor','interp');
xlabel('X')
ylabel('Y')
zlabel('Z')
axis equal
colormap('jet');
colorbar
figure(3)
trisurf(tri,x,y,z,Ad,'facecolor','interp','edgecolor','none');
xlabel('X')
ylabel('Y')
zlabel('Z')
axis equal
colormap('jet');
colorbar

카테고리

도움말 센터File Exchange에서 Pattern Data Integration and Visualization에 대해 자세히 알아보기

질문:

2017년 7월 4일

답변:

43분 전

Community Treasure Hunt

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

Start Hunting!

Translated by