MATLAB Answers

How to cut off 1/4 of half sphere

13 views (last 30 days)
Hello! I'm a rookie in Matlab worId... I want to make an illustration of 3/8 of a sphere (this is, just 3/4 of the upper half) but I would like to do it without changing the current axis limits. Anyone can help, please? Thanks a lot! Have a nice day! (:
Target:
Current:
Current code:
[x y z]=sphere;
r=378;
surf(r*x,r*y,r*z+81.250);
xlabel('x axis [mm]')
ylabel('y axis [mm]')
zlabel('z axis [mm]')

Accepted Answer

Cris LaPierre
Cris LaPierre on 8 May 2021
Set the corresponding quadrant values equal to nan. There are several ways to do this. Here is one.
[x y z]=sphere;
x(11:end,1:5)=nan;
r=378;
surf(r*x,r*y,r*z+81.250);

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by