Drawing a sphere inside a sphere?

1 vue (au cours des 30 derniers jours)
Mark
Mark le 25 Juil 2012
Commenté : Star Strider le 16 Mai 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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (1)

Matt
Matt le 25 Juil 2012
Another possible solution is to simply add
hidden off
to the very end of your code.
  1 commentaire
Mark
Mark le 26 Juil 2012
Works, thank you!

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by