# [SOLVED]Antenna radiation 3d plotting in Scilab

Status
Not open for further replies.

#### Masak

##### Newbie level 3 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");

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.

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

• Masak

### Masak

points: 2

#### Masak

##### Newbie level 3 "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?

#### Masak

##### Newbie level 3 "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.