Main Content

multisphere

Create geometry formed by several spherical cells

Description

gm = multisphere(R) creates a geometry by combining several spherical cells.

When creating each sphere, multisphere uses the following coordinate system.

Sphere in x, y, z coordinates with its center at the origin

example

gm = multisphere(R,"Void",eci) creates a multi-sphere geometry with empty cells.

example

Examples

collapse all

Create a geometry that consists of three nested spheres.

Create the geometry by using the multisphere function. The resulting geometry consists of three cells.

gm = multisphere([5 10 15])
gm = 
  DiscreteGeometry with properties:

       NumCells: 3
       NumFaces: 3
       NumEdges: 0
    NumVertices: 0
       Vertices: []

Plot the geometry.

pdegplot(gm,CellLabels="on",FaceAlpha=0.2)

Figure contains an axes object. The axes object contains 5 objects of type quiver, text, patch.

Create a geometry that consists of a single sphere.

Use the multisphere function to create a single sphere. The resulting geometry consists of one cell.

gm = multisphere(5)
gm = 
  DiscreteGeometry with properties:

       NumCells: 1
       NumFaces: 1
       NumEdges: 0
    NumVertices: 0
       Vertices: []

Plot the geometry.

pdegplot(gm,CellLabels="on")

Figure contains an axes object. The axes object contains 5 objects of type quiver, text, patch.

Create a hollow sphere geometry.

Create a hollow sphere by using the multisphere function with the Void argument. The resulting geometry consists of one cell.

gm = multisphere([9 10],Void=[true,false])
gm = 
  DiscreteGeometry with properties:

       NumCells: 1
       NumFaces: 2
       NumEdges: 0
    NumVertices: 0
       Vertices: []

Input Arguments

collapse all

Cell radius, specified as a positive real number or a vector of positive real numbers. If R is a vector, then R(i) specifies the radius of the ith cell.

Example: gm = multisphere([1,2,3])

Empty cell indicator, specified as a vector of logical true and false values. This vector must have the same length as the radius vector R.

The value true corresponds to an empty cell. By default, multisphere assumes that all cells are not empty.

Example: gm = multisphere([1,2,3],Void=[false,true,false])

Output Arguments

collapse all

Geometry object, returned as a DiscreteGeometry object.

Version History

Introduced in R2017a