Plotting the function on a Sphere?

14 Ansichten (letzte 30 Tage)
Jagadeesh Korukonda
Jagadeesh Korukonda am 17 Aug. 2022
Kommentiert: Torsten am 22 Aug. 2022
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.

Antworten (1)

KSSV
KSSV am 17 Aug. 2022
Bearbeitet: KSSV am 17 Aug. 2022
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 Kommentare
Jagadeesh Korukonda
Jagadeesh Korukonda am 22 Aug. 2022
But where we plot C?
Torsten
Torsten am 22 Aug. 2022
What do you think: why does the surface of the sphere have different colors ?

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by