I posted this question under another thread, however I think the activity went dry after I replied to a post. I'm reposting my question here to see if I can restart the get fresh sets of eyes.
I'm attempting to plot three columns contained in a txt file to a 3D plot that visually describes the radiation pattern of an antenna that I have tested. The three columns contain theta, phi, and power values. In my code I convert all the degree values to radians, then translate all the power values up so that they are all positive. Then I convert all the values from spherical to cartersian. From here I would like to create a 3D plot of my set of coordinates using the mesh command. However, I receive an error which is copied below.
I am not sure how to plot my data another way. I'm failry new to matlab so please forgive me if this is really trivial.
Much appreciated!
Windell
??? CData must be an MbyN matrix or MbyNby3 array.
Error in ==> mesh at 135
hh = graph3d.surfaceplot(x,y,z,'FaceColor',fc,'EdgeColor','flat', ...
Error in ==> mesh3D at 19
mesh(X,Y,Z)
Here is my code...
%load & store the signal angle of attack values.
load monopole3D.txt
theta = monopole3D(:,1);
phi=monopole3D(:,2);
r=monopole3D(:,3);
%convert to radians.
theta=(pi/180)*theta;
phi=(pi/180)*phi;
%make the radius not negative.
r=r+40;
%convert spherical coordinates to rectangular coordinates.
[x,y,z]=sph2cart(theta,phi,r);
[X,Y,Z]=meshgrid(x,y,z);
%plot in 3D
mesh(X,Y,Z)
