我认为你可以使用delaunay创建一个三角测量和使用trimesh或trisurf的情节.
trimesh作为trisurf接受第四个参数来指定每个顶点的颜色,添加选项'facecolor','interp'
以插入顶点之间每个面的颜色.
编辑:我对它进行了更多的实验,因为它是一个球体,我认为convhull更适合.
例:
[x,y,z]=sphere(25);
x=x(:);y=y(:);z=z(:);
tri = convhull([x y z]);
C = cos(y);
trisurf(tri,x,y,z,C,'facecolor','interp');
Run Code Online (Sandbox Code Playgroud)
而不是C
在示例中,您可以使用自己的值向量来指定颜色