3D pattern problem in Matlab
时间:03-31
整理:3721RD
点击:
hi
Dear friends
How can I draw this 3D digram in Matlab please help me.
And it's diffrent !
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