Convert data plot from Cartesian to spherical coordinates

7 visualizaciones (últimos 30 días)
I have data plot shown below where the 'x' and 'y' coordiantes corresponds to the cartessian coordinates sin(theta) cos(phi) and sin(theta) sin(phi). I would like to obtain a plot where the 'x' and 'y' coordinates are theta and phi. Is there a command in Matlab that performs this coordinate transformation? theta and phi are the spherical coordinates.

Respuesta aceptada

Star Strider
Star Strider el 18 de Sept. de 2020
See if the cart2sph function will do what you want.
  2 comentarios
Manushanker Balasubramanian
Manushanker Balasubramanian el 18 de Sept. de 2020
I tried cart2sph the image obtained is not right. In the initial data theta varies form -pi/2 to pi/2 and phi varies from 0 to 2*pi
Star Strider
Star Strider el 18 de Sept. de 2020
It may be necessary to plot it with the surf function to see it correctly.
Beyond that, I have no idea what the problem could be.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by