sphere
Generate coordinate matrices for a unit sphere.
Syntax
Section titled “Syntax”[X, Y, Z] = sphere[X, Y, Z] = sphere(n)Description
Section titled “Description”Returns (n+1) × (n+1) coordinate matrices for a unit sphere — pass to surf or mesh to render. Default n = 20 (smoother spheres need higher n). Without output arguments, plots directly.
Examples
Section titled “Examples”sphere(50) % render a 50-faceted sphere directly[X, Y, Z] = sphere(30); surf(X, Y, Z)