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.