MATLAB 3D函数sphere()

球体函数可生成单位球体的x, y和z坐标, 以用于冲浪和网格。
句法

sphere // It generates a sphere consisting of 20-by-20 faces.sphere(n) // It draws a surf plot of an n-by-n sphere in the current figure.[X, Y, Z] = sphere(...) // It returns the coordinates of a sphere in three matrices that are (n+1)-by-(n+1) in size.

例子
【MATLAB 3D函数sphere()】生成并绘制一个球体。
sphere(20)axis('square')or[x, y, z]=sphere(20); surf(x, y, z)axis('square')

输出
MATLAB 3D函数sphere()

文章图片

    推荐阅读