Plotting a region of a sphere
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eduard Almar Oliva
am 26 Mär. 2021
Kommentiert: Eduard Almar Oliva
am 29 Mär. 2021
How can I plot the 3D region in spherical coordinates delimited by the following inequalities:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563376/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563381/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563386/image.png)
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563391/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563396/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563401/image.png)
1 Kommentar
Sulaymon Eshkabilov
am 26 Mär. 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.
Akzeptierte Antwort
darova
am 26 Mär. 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/563781/image.png)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!