Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to plot radiation pattern in matlab

Status
Not open for further replies.

doooo

Newbie level 5
Newbie level 5
Joined
Apr 2, 2014
Messages
10
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Visit site
Activity points
72
hi everybody,
can anybody expalin how to make 3D polar radiation pattern in matlab?
I am using UV plot where with mesh(x,y,z) command
x=sin(theta)cos(phi)
y=sin(theta)sin(phi)
ans
z=calculated gain
all are NxN square matrix
But I want to plot in polar form
Thanks

Hi, mns. This is my m-file for 3D radiation pattern in linear scale.
First, I get radiation pattern information in spherical coordinate from HFSS.
Then I need to extract directivities depends on phi, theta.
Anyway, the important thing is that you know values in spherical coordinates then should transfer to rectangular coordinates.
You also consider meshgrid depends on your simulation settings(phi, theta steps).

One thing I want to do is, wanna plot my directivity in dB scale. I'm in trouble.

Thanks.

--------------------------------------------------------------------------------------

Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
c=importdata('F:\2014_SPRC\Matlab\Prob1\5GHz_radiation pattern.xlsx');
Directivity=c.data(:,3); %where my directivity values
 
r = zeros(19,37); % theta, phi, 10 degree step
 
n=0;
for i=1:size(r,1)
    for j=1:size(r,2)
       r(i,j) = Directivity(n+j);
    end
       n = size(r,2)*i;
end;
 
[phi,theta] = meshgrid(linspace(0,360,37), linspace(0,180,19)); % 10 degree step
 
 
x = r.*sin(theta*pi/180).*cos(phi*pi/180);
y = r.*sin(theta*pi/180).*sin(phi*pi/180);
z = r.*cos(theta*pi/180);
figure
surf(x,y,z,r);
shading interp;


---------------------------------------------------------------------------------
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top