Main Content

antenna.Rectangle

Create rectangle centered at origin on X-Y plane

Description

Use the antenna.Rectangle object to create a rectangle centered at the origin and on the X-Y plane. You can use antenna.Polygon to create single-layer or multi-layered antennas using pcbStack.

Creation

Description

example

rect = antenna.Rectangle creates a rectangle centered at the origin and on the X-Y plane.

example

rect = antenna.Rectangle(Name=Value) sets properties using one or more name-value pair. Name is the property name and Value is the corresponding value. You can specify several name-value arguments in any order as Name1= Value1, ..., NameN=ValueN. Properties not specified retain their default values.

Properties

expand all

Name of rectangle, specified as a string or a character vector.

Example: "Rect1"

Data Types: char | string

Cartesian coordinates of center of rectangle, specified as a 2-element vector with each element measured in meters.

Example: [0.006 0.006]

Data Types: double

Rectangle length, specified as a scalar in meters.

Example: 2

Data Types: double

Rectangle width, specified as a scalar in meters.

Example: 4

Data Types: double

Number of discretization points per side, specified as a scalar.

Example: 16

Data Types: double

Object Functions

addBoolean unite operation on two shapes
subtractBoolean subtraction operation on two shapes
intersectBoolean intersection operation on two shapes
plusShape1 + Shape2
minusShape1 - Shape2
andShape1 & Shape2
areaCalculate area of shape in square meters
showDisplay antenna, array structures or shapes
plotPlot boundary of shape
meshMesh properties of metal, dielectric antenna, or array structure
rotateRotate shape about axis and angle
rotateXRotate shape about x-axis and angle
rotateYRotate shape about y-axis and angle
rotateZRotate shape about z-axis and angle
translateMove shape to new location
scaleChange the size of the shape by a fixed amount
mirrorXMirror shape along X-axis
mirrorYMirror shape along Y-axis
removeHolesRemove holes from shape
removeSliversRemove sliver outliers from boundary of shape

Examples

collapse all

Create a rectangle shape using antenna.Rectangle and view it.

r1 = antenna.Rectangle
r1 = 
  Rectangle with properties:

         Name: 'myrectangle'
       Center: [0 0]
       Length: 1
        Width: 2
    NumPoints: 2

show(r1)

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, myrectangle.

Create and view a rectangle with a length of 2 m and a width of 4 m.

r2 = antenna.Rectangle(Length=2,Width=4);
show(r2)
axis equal

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, myrectangle.

Rotate the rectangle.

rotateZ(r2,45);

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, myrectangle.

show(r2)

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, myrectangle.

Create a rectangle with a length of 0.15 m, and a width of 0.15 m.

r  = antenna.Rectangle(Length=0.15,Width=0.15);

Create a second rectangle with a length of 0.05 m, and a width of 0.05 m. Set the center of the second rectangle at half the length of the first rectangle r.

n = antenna.Rectangle(Center=[0.075,0],Length=0.05,Width=0.05);

Create and view a notched rectangle by subtracting n from r.

rn  = r-n;
show(rn)

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

Calculate the area of the notched rectangle.

area(rn)
ans = 0.0212

Version History

Introduced in R2017a