![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179772/image.png)
plot a partial sphere with a circular top like a bowl
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
monarch
am 2 Dez. 2017
Bearbeitet: monarch
am 2 Dez. 2017
I'd like to plot a partial sphere (like a bowl) where the radius from the centroid to the edge is .1385 and the radius of the mouth of the bowl is .0525.
I have this but I couldn't figure out how to cut off the square-ish top to only show the bowl-like shape
R = .1385;
[X,Y] = meshgrid(-.07:.001:.07);
Z = sqrt(R.^2 + X.^2 + Y.^2);
Z(imag(Z) ~= 0) =0;
mesh(X,Y,Z);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170551/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Akira Agata
am 2 Dez. 2017
I think one possible solution would be fsurf function. How about the following script?
R = 0.1385;
r1 = 0.0525;
theta = asin(r1/R);
funx = @(u,v) R*cos(u).*sin(v);
funy = @(u,v) R*sin(u).*sin(v);
funz = @(u,v) -R*cos(v);
fsurf(funx,funy,funz,[0 2*pi 0 theta])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179772/image.png)
2 Kommentare
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!