This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Generate ellipsoid


[x,y,z] = ellipsoid(xc,yc,zc,xr,yr,zr,n)
[x,y,z] = ellipsoid(xc,yc,zc,xr,yr,zr)


[x,y,z] = ellipsoid(xc,yc,zc,xr,yr,zr,n) generates a surface mesh described by three n+1-by-n+1 matrices, enabling surf(x,y,z) to plot an ellipsoid with center (xc,yc,zc) and semi-axis lengths (xr,yr,zr).

[x,y,z] = ellipsoid(xc,yc,zc,xr,yr,zr) uses n = 20.

ellipsoid(axes_handle,...) plots into the axes with handle axes_handle instead of the current axes (gca).

ellipsoid(...) with no output arguments plots the ellipsoid as a surface.


collapse all

Generate data for an ellipsoid with a center at (0,0,0) and semi-axis lengths (5.9,3.25,3.25). Use surf to plot the ellipsoid.

[x, y, z] = ellipsoid(0,0,0,5.9,3.25,3.25,30);
surf(x, y, z)
axis equal


ellipsoid generates the data using the following equation:


Note that ellipsoid(0,0,0,.5,.5,.5) is equivalent to a unit sphere.

See Also

| |

Introduced before R2006a