Plotting a region of a sphere

22 visualizaciones (últimos 30 días)
Eduard Almar Oliva
Eduard Almar Oliva el 26 de Mzo. de 2021
Comentada: Eduard Almar Oliva el 29 de Mzo. de 2021
How can I plot the 3D region in spherical coordinates delimited by the following inequalities:
Where theta, phi, and rho are the same as the ones described here: https://es.mathworks.com/help/symbolic/plotting-in-spherical-coordinate-system.html
The region should look like this:
  1 comentario
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 26 de Mzo. de 2021
Note that you have a hollow sphere with cutouts. Therefore, you need to set up the formulation first and then write a code to simulate and plot it.

Iniciar sesión para comentar.

Respuesta aceptada

darova
darova el 26 de Mzo. de 2021
Her is start:
clc,clear
[T1,T2] = meshgrid(-60:5:60,-90:5:200);
[x,y,z] = sph2cart(T2*pi/180,T1*pi/180,5);
[R,T] = meshgrid(1:0.2:2,0:5:360);
[X,Y] = pol2cart(T*pi/180,R);
Z = 2*R;
surf(x,y,z)
hold on
surf(X,Y,Z)
hold off
  1 comentario
Eduard Almar Oliva
Eduard Almar Oliva el 29 de Mzo. de 2021
Thank you very much. This was very helpful!

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