[SOLVED] Antenna radiation 3d plotting in Scilab

Status
Not open for further replies.

Masak

Newbie level 3
Joined
May 21, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
25
Can anyone help me with my 3d plot?
I need to plot the Antenna response at given theta and phi angles.
I have 19 steps of theta from -pi/2 to +pi/2 with 10 degrees for each step.
I have 361 steps of phi from -pi to +pi with 1 degree for each step.

for each step of theta I have 361 measured response (R).
In total I have 19*361 = 6859 values of R.

My code is giving me spiky graph rather than a surface graph.


clf;
clear;

C = fscanfMat('C:\Measurements.dat', "%lg");

Theta_Rad = linspace(-%pi/2,%pi/2,19);

Phi_Rad = linspace(-%pi,%pi,361);

R = C(2:6860,2);

n = 1;

for i=1:19
for j=1:361
X= R.*sin(Phi_Rad(j))'*cos(Theta_Rad(i));
Y= R.*sin(Phi_Rad(j))'*sin(Theta_Rad(i));
Z= R.*cos(Phi_Rad(j))'*ones(Theta_Rad(i));
n = n+1;
end;
end

plot3d3(X,Y,Z);

When I compared each cut (of the 19 steps) with the corresponding 2d plot they were identical.
I also tried to use the "mesh" and the "eval3dp" but I keep getting errors.

I want to to have a smooth surface plotting rather than spiky graph.

I would really appreciate it if anyone can help me with this.
Thanks in advanced.
 

"Measurements.dat" indicates that you have measured data. Can the spikes come from the data itself?
 
Reactions: Masak

    Masak

    Points: 2
    Helpful Answer Positive Rating
"Measurements.dat" indicates that you have measured data. Can the spikes come from the data itself?

The plot function I'm using is not displaying a sphere. It is only displaying 19 different contours which share the same center. The diameter at each point of the contour represents the strength of the signal at this specific point. I want to display a sphere rather than isolated contours?
 

"Measurements.dat" indicates that you have measured data. Can the spikes come from the data itself?

Thanks a lot flanello
I managed to solve it now! It turns out that the measured data were all in db and all negative. Once I added an offset value to make them all positive I got the right plot.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…