當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


MATLAB sphere()用法及代碼示例

sphere 函數開發單位球體的 x-、y- 和 z-coordinates,用於衝浪和網格。

用法

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 sphere()



相關用法


注:本文由純淨天空篩選整理自 MATLAB sphere()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。