Plotting antenna field patterns in spherical coordinates
Mostrar comentarios más antiguos
Hi, I have a 2D array which of the form A(theta, phi) and I want to plot A as a 3D surface. I have read advice which suggests to use the sph2cart function to convert to Cartesian coordinates, then use surf or mesh, but as size(A) = 46 90, i.e. it is not a square 2D array, it will not work. Any suggestions? Thanks
Respuesta aceptada
Más respuestas (2)
Ebrahim Forati
el 10 de Jun. de 2020
2 votos
Just added a couple of fixes to Kelley's answer:
theta = linspace(-pi/2, pi/2, 90); % theta is w.r.t. xy plane
phi = linspace(0, 2*pi, 46);
[theta, phi] = meshgrid(theta, phi);
A = ones(size(theta));
[x,y,z] = sph2cart(phi, theta, A); % fixed this line too
mesh(x,y,z)
Vishwanath Iyer
el 3 de Jun. de 2021
0 votos
Consider the following function in Antenna Toolbox for plotting radiation patern data:
Categorías
Más información sobre Antennas, Microphones, and Sonar Transducers en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!