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

 Akzeptierte Antwort

Honglei Chen
Honglei Chen am 25 Jul. 2012

2 Stimmen

You can add
alpha(0.5)
after you plot the first one.

3 Kommentare

Mark
Mark am 26 Jul. 2012
Excellent thank you
Juan Gomez
Juan Gomez am 16 Mai 2021
Sorry, i'm new to Matlab. I have a question. What is "alpha" for?
Star Strider
Star Strider am 16 Mai 2021
It’s the patch transparency parameter, now called FaceAlpha.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Matt
Matt am 25 Jul. 2012

1 Stimme

Another possible solution is to simply add
hidden off
to the very end of your code.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by