Borrar filtros
Borrar filtros

How can I truncate a prolate spheroid?

1 visualización (últimos 30 días)
Nicholas
Nicholas el 4 de Ag. de 2014
Comentada: Nicholas el 4 de Ag. de 2014
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

Respuesta aceptada

Image Analyst
Image Analyst el 4 de Ag. de 2014
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 comentario
Nicholas
Nicholas el 4 de Ag. de 2014
Thanks very much - a simple and effective solution.
Cheers
Nic

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by