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. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Boolean unite operation on two shapes


c = add(shape1,shape2)



c = add(shape1,shape2) unites shape1 and shape2 using the add operation. You can also use the + to add the two shapes together.


collapse all

Create and view a default circle.

circle1 = antenna.Circle;

Create a circle with a radius of 1 m. The center of the circle is at [1 0].

circle2 = antenna.Circle('Center',[1 0],'Radius',1);

Add the two circles.


Create circle with a radius of 1 m. The center of the circle is at [1 0].

circle1 = antenna.Circle('Center',[1 0],'Radius',1);

Create a rectangle with a length of 2 m and a width of 4 m centered at the origin.

rect1 = antenna.Rectangle('Length',2,'Width',2);

Add the two shapes together using the + function.

polygon1 = circle1+rect1
polygon1 = 
  Polygon with properties:

        Name: 'mypolygon'
    Vertices: [60x3 double]


Input Arguments

collapse all

Shapes created using custom elements and shape objects of Antenna Toolbox™, specified as an object handle.

Example: c = add(rectangle1, rectangle2) where rectangle1 and rectangle2 are shapes created using antenna.Rectangle object.

Introduced in R2017a

Was this topic helpful?