![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175347/image.jpeg)
How can I truncate a prolate spheroid?
2 次查看(过去 30 天)
显示 更早的评论
I first generated a prolate spheroid through:
[x y z] = sphere;
x = x;
y = y;
z = 2*z;
surf(x,y,z), axis equal
I need to truncate the prolate spheroid at one end. What is a simple way of doing this?
Cheers,
Nic
0 个评论
采纳的回答
Image Analyst
2014-8-4
Try using logical indexing to set the top flat:
[x y z] = sphere(100);
x = x;
y = y;
z = 2*z;
highZ = z > 1;
x(highZ) = 0;
y(highZ) = 0;
z(highZ) = 1;
surf(x,y,z);
axis equal
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175347/image.jpeg)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!