Drawing a sphere inside a sphere?

1 次查看(过去 30 天)
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

采纳的回答

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

请先登录,再进行评论。

更多回答(1 个)

Matt
Matt 2012-7-25
Another possible solution is to simply add
hidden off
to the very end of your code.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by