个性化阅读
专注于IT技术分析

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.

例子

生成并绘制一个球体。

sphere(20)
axis('square')
or
[x, y, z]=sphere(20);
surf(x, y, z)
axis('square')

输出

MATLAB 3D函数sphere()

赞(0)
未经允许不得转载:srcmini » MATLAB 3D函数sphere()

评论 抢沙发

评论前必须登录!