Plotting the function on a Sphere?

조회 수: 27 (최근 30일)
Jagadeesh Korukonda
Jagadeesh Korukonda 2022년 8월 17일
댓글: Torsten 2022년 8월 22일
Let me explain, what I'm actually solving.
I'm solving Diffusion-Reaction equation(3D) in spherical coordinates.
I'm solving this equation numerically. So at the end I'm getting , r, θ, ϕ.
So I want to plot this function on a sphere( - plane) instead of palne
Can anyone help in this regard?
Thanks in advance.

답변 (1개)

KSSV
KSSV 2022년 8월 17일
편집: KSSV 2022년 8월 17일
r = 1 ;
th = linspace(0,2*pi) ;
phi = linspace(0,pi) ;
[T,P] = meshgrid(th,phi) ;
X = r*cos(T).*sin(P) ;
Y = r*sin(T).*sin(P) ;
Z = r*cos(P) ;
surf(X,Y,Z)
axis equal
  댓글 수: 2
Jagadeesh Korukonda
Jagadeesh Korukonda 2022년 8월 22일
But where we plot C?
Torsten
Torsten 2022년 8월 22일
What do you think: why does the surface of the sphere have different colors ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by