微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > 3D pattern problem in Matlab

3D pattern problem in Matlab

时间:03-26 整理:3721RD 点击:
hi
Dear friends
How can I draw this 3D digram in Matlab please help me.

Hi
You can use mesh and surf commands:
Be sure to X,Y and Z have the same dimmensions.

The following code plot the 3D radiation pattern of an antenna:

Phi=(-180:1:180)*pi/180;
Theta=(0:180)*pi/180;
[PHI,THETA]=meshgrid(Phi,Theta);
R= VERTICAL --> This is the radiation field.
X=R.*sin(THETA).*cos(PHI);
Y=R.*sin(THETA).*sin(PHI);
Z=R.*cos(THETA);

figure();
mesh(X,Y,Z); %display
surf(X,Y,Z) %colored faces )

dear acrislg
thanks for your reply

I try this code but unfortunately obtain this plot:

Code:
Phi=(0:1:180)*2*pi/180; 
Theta=(0:1:180)*2*pi/180; 


[THETA,PHI]=meshgrid(Theta,Phi); 
R=sqrt(1-(sin(THETA)^2.*sin(PHI)^2)).*(sin(pi.*cos(THETA)));
X=R.*sin(THETA).*cos(PHI); 
Y=R.*sin(THETA).*sin(PHI); 
Z=R.*cos(THETA); 


figure(); 
mesh(X,Y,Z); %display 
surf(X,Y,Z) %colored faces
And it's diffrent !

上一篇:strange problem in CST
下一篇:最后一页

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

网站地图

Top