필터 지우기
필터 지우기

Drawing a sphere inside a sphere?

조회 수: 3 (최근 30일)
Mark
Mark 2012년 7월 25일
댓글: Star Strider 2021년 5월 16일
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.
  댓글 수: 1
Mark
Mark 2012년 7월 26일
Works, thank you!

댓글을 달려면 로그인하십시오.

카테고리

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