Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

sphere

The sphere function generates the x-, y-, and z-coordinates of a unit sphere for use with surf and mesh.

sphere()

Draws a surf plot of an 20-by-20 sphere in the current figure.

Returns 1. entry

Arguments

Example

[X, Y, Z] = sphere()

Returns the three matrices with x-, y-, and Z coordinates for a unit sphere. The matrices are saved in the variables X, Y, Z.

sphere(n)

Draws a surf plot of an n-by-n sphere in the current figure.

Argument n

Scalar

Returns 1. entry

Arguments

Example

[X, Y, Z] = sphere(30)

Returns the three matrices with x-, y-, and Z coordinates for a unit sphere with n = 30. The 31x31 matrices are saved in the variables X, Y, Z.

Clone this wiki locally