Drawing a sphere inside a sphere?

4 visualizaciones (últimos 30 días)
Mark
Mark el 25 de Jul. de 2012
Comentada: Star Strider el 16 de Mayo de 2021
Is it possible to draw a sphere inside a sphere? I tried the following, but this covers the small sphere, despite the "mesh" instead of "surf":
[x,y,z] = sphere();
r = 5;
mesh( r*x, r*y, r*z );
hold on
r = 2;
mesh( r*x, r*y, r*z );
hold off

Respuesta aceptada

Honglei Chen
Honglei Chen el 25 de Jul. de 2012
You can add
alpha(0.5)
after you plot the first one.
  3 comentarios
Juan Gomez
Juan Gomez el 16 de Mayo de 2021
Sorry, i'm new to Matlab. I have a question. What is "alpha" for?
Star Strider
Star Strider el 16 de Mayo de 2021
It’s the patch transparency parameter, now called FaceAlpha.

Iniciar sesión para comentar.

Más respuestas (1)

Matt
Matt el 25 de Jul. de 2012
Another possible solution is to simply add
hidden off
to the very end of your code.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by