matlab sphere函数 画球问题
1个回答

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的球