Main Content

plus

Join two shapes

Description

plus(shape1,shape2) joins the shape1 with shape2 and plots the resultant shape. Alternatively, you can also use the '+' operator to join the shapes.

example

c = plus(shape1,shape2) joins the shape1 with shape2 and returns a polygon object for resultant 2-D shape or a custom 3-D object for resultant 3-D shape. Alternatively, you can also use the '+' operator to join the shapes.

example

Examples

collapse all

Create and join a rectangular and a circular shape.

r = antenna.Rectangle;
c = antenna.Circle; 
plus(r,c);

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Alternatively, you can directly join shapes using the '+' operator.

r + c;

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Create and join a box and a custom 3-D shape.

b = shape.Box;
c = shape.Custom3D; 
s = plus(b,c)
s = 
  Custom3D with properties:

              Name: 'custom3D'
          Vertices: [23×3 double]
             Metal: 'PEC'
        Dielectric: 'Air'
    FrequencyModel: 'Constant'
             Color: 'Individual'
      Transparency: 'Individual'
         EdgeColor: 'Individual'

Alternatively, you can directly join shapes using the '+' operator.

b + c;

Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 3 objects of type patch.

Input Arguments

collapse all

Shapes to join, specified as objects from the following list:

Example: plus(antenna.Rectangle,antenna.Circle)

Example: plus(shape.Box,shape.Custom3D)

Output Arguments

collapse all

Resultant shape after joining two 2-D or 3-D shapes, returned as one of the following shape objects:

Example: antenna.Polygon

Example: shape.Polygon

Example: shape.Custom3D

Version History

Introduced in R2017a