Rectangle function: Creates a two-dimensional rectangular object.
Rectangle (' Position ', [x,y,w,h])
Draws a rectangle of width W high h from the point (x, y) and assigns a value to the Axis data unit.
Notice that the rectangle is displayed at a specified scale, and you need to set the axis data aspect ratio so that the x and Y axes have equal units of length. You can use the command axis equal or daspect ([1,1,1]).
Rectangle draws a rectangle whose default position is [0,0,1,1], and the default curvature is [0,0] (that is, no curvature).
Rectangle (..., ' curvature ', [x, y]) specifies the curvature of the edge of the matrix, which can vary from rectangle to ellipse, horizontal curvature x is the fraction of the rectangle width, and is bent along the top and bottom edges of the rectangle. The vertical curvature y is the fraction of the rectangular height, which bends along the left and right edges of the rectangle. The X and Y values range from 0 (no curvature) to 1 (maximum curvature). The value [0,0] Draws a rectangular rectangle, and the value [x, Y] draws an ellipse. If you specify only one value of curvature, then both the horizontal and vertical curvature have the same value.
h = Rectangle (...) Returns a handle to the created Rectangle object.
Note: The rectangle object is 2 dimensional, can only be drawn in the range of [0] (i.e., view (2)), the Rectangle object is a sub-object of the coordinates, is defined within the axis data.
Examples: Rectangle (' position ', [1,1,5,5], ' curvature ', [St], ' Edgecolor ', ' r ', ' Facecolor ', ' G ');
' Position ', [1,1,5,5] indicates a height of 5 from (a) point and a width of 5;
' Curvature ', [n] means that the curvature is 1 in the X, y direction, which is the arc;
' Edgecolor ', ' r ' indicates that the border color is red;
' Facecolor ', ' g ' indicates that the fill color in the polygon is green.
See the graphic:
The rectangle function in matlab