필터 지우기
필터 지우기

How can I truncate a prolate spheroid?

조회 수: 1 (최근 30일)
Nicholas
Nicholas 2014년 8월 4일
댓글: Nicholas 2014년 8월 4일
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

채택된 답변

Image Analyst
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
  댓글 수: 1
Nicholas
Nicholas 2014년 8월 4일
Thanks very much - a simple and effective solution.
Cheers
Nic

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by