如何将矢量列表绘制为球体?

jag*_*ttt 2 3d matlab plot geometry

我有一组标准化的矢量(其中1538个)形成一个球体.此外,我有一个1538相同大小的数字数组.我想绘制这样的东西:

在此输入图像描述

我尝试了spheresurf函数,但我找不到使用我的向量的方法.我认为应该有一些方法来做到这一点.

非常感谢.

Gun*_*uyf 5

我认为你可以使用delaunay创建一个三角测量和使用trimeshtrisurf的情节.

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)

trisurf_colored

而不是C在示例中,您可以使用自己的值向量来指定颜色