채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 23일
편집: Azzi Abdelmalek 2015년 6월 23일

0 개 추천

sphere(20)
axis square
You can get the coordinates x,y and z
[x,y,z]=sphere(20)
You can plot a sphere
surf(x,y,z)

댓글 수: 4

cob
cob 2015년 6월 23일
thank but it is not the same figure.
cob
cob 2015년 6월 23일
i do know ho to plot the sphere , i dont know how to plot this black square inside this sphere
Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 23일
편집: Azzi Abdelmalek 2015년 6월 23일
ii=-1:0.1:1
jj=-1:0.1:1
[ii1,jj1]=meshgrid(ii,jj)
surf(ii,jj,zeros(size(ii1)))
hold on
sphere(20)
cob
cob 2015년 6월 23일
편집: cob 2015년 6월 23일
Thanks a lot , i did a little modification base on your code : x = -2:0.1:2;
y = -2:0.1:2;
[X,Y] = meshgrid(x,y);
surf(x,y,zeros(size(X)),'Facecolor','black');
hold on
sphere(25);
axis square
legend('the square',' the ball of 20','Location','SouthWest');

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

추가 답변 (0개)

카테고리

질문:

cob
2015년 6월 23일

편집:

cob
2015년 6월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by