yhkn.net
当前位置:首页 >> mAtlABsphErE怎么画球 >>

mAtlABsphErE怎么画球

t是用来定义画球面时点的颜色,你的程序里t = p也就是颜色由P来决定,就是三维图形里面点的纵轴(z轴)的绝对值决定.同心圆程序如下:clc,clear all; figure (1) [m,n,p]=sphere(50); t=abs(p); surf(m,n,p,t); hold on; mesh(2*m,2*n,2*p),colormap(hot); hold off; hidden off axis equal mesh(2*m,2*n,2*p),产生半径为2的球

[x,y,z]=sphere(30);surf(x,y,z) axis equal或者sphere(30)axis equal直接出图

在figure窗口的工具栏上,按“Edit Plot”按钮(一个箭头图标),进入编辑.在“Edges”右边选择颜色-黑色,即可.如下是效果图(关闭了坐标轴):

[x,y,z]=sphere; surf(7*x,7*y,7*z) 可以用很多方法的 这种是专门画圆的

>> [x,y,z]=sphere(50);>> surf(x,y,z);>> axis equal;>> shading interp>> colorbar

% 圆柱 t=ones(1,40)*5; [x,y,z]=cylinder(t); c=ones(size(z)); surf(x,y,z,c) shading faceted title('圆柱') axis off % 椭球 t=linspace(0,pi,100); [x,y,z]=cylinder(sin(t)/4); c=ones(size(z)); mesh(x,y,z,c) shading faceted title('椭球') axis equal axis off

>> sphere(20) >> for i=1:760 camorbit(10,0,'data',[0,0,1]) drawnow end

sphere函数加mesh或surf改变圆心的坐标即可clc[xyz]=sphere(50);mesh(3*x,3*y,3*z+9);holdonmesh(3*x+5,3*y+5,3*z+14);mesh(3*x+10,3*y+10,3*z+19);axisequal

>>sphere(100)

x0=2;y0=3;z0=4;%球心 r=5;%半径%下面开始画 [x,y,z]=sphere; mesh(r*x+x0,r*y+y0,r*z+z0) axis equal

网站首页 | 网站地图
All rights reserved Powered by www.yhkn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com