Convert data plot from Cartesian to spherical coordinates

3 次查看(过去 30 天)
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.

采纳的回答

Star Strider
Star Strider 2020-9-18
See if the cart2sph function will do what you want.
  2 个评论
Manushanker Balasubramanian
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 2020-9-18
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cartesian Coordinate System Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by