Convert data plot from Cartesian to spherical coordinates

조회 수: 7 (최근 30일)
Manushanker Balasubramanian
Manushanker Balasubramanian 2020년 9월 18일
댓글: Star Strider 2020년 9월 18일
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
Manushanker Balasubramanian 2020년 9월 18일
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에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by