MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   【求助】请问如何让这个球转动? (https://www.labfans.com/bbs/showthread.php?t=964)

szj1123szj 2007-12-13 10:38

【求助】请问如何让这个球转动?
 
clear,clc
r=5;
[x,y]=meshgrid(-r-r/100:r/115:r+r/100);
z=(sqrt(r^2-x.^2-y.^2));
n=size(z);
for i=1:n
for j=1:n
if ~isreal(z(i,j)) & imag(z(i,j))>.75
z(i,j)=nan;
z1(i,j)=nan;
else
z(i,j)=real(z(i,j));
z1(i,j)=-real(z(i,j));
end
end
end
mesh(x,y,z)
hold on
%surf(x,y,z)
mesh(x,y,z1)
%surf(x,y,z1)
axis tight
shading interp
alpha(.9)


转载自 作者:cxf208

elunxu 2007-12-20 21:48

利用camorbit函数


所有时间均为北京时间。现在的时间是 09:50

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.