%% Draw Rectangle with Curved Edges
% Draw a rectangle that has a lower left corner at (0,0) and an upper right corner at (2,4). Create the rectangle with curved corners by specifying the curvature as the scalar value 0.2. For data units of equal length along both the x-axis and y-axis, use axis equal.

figure
rectangle('Position',[0 0 2 4],'Curvature',0.2)
axis equal

%
% Add a second rectangle that has the shortest side completely curved by specifying the curvature as the scalar value 1.

rectangle('Position',[3 0 2 4],'Curvature',1)

%
% Add a third rectangle and use different curvatures along the horizontal and vertical sides. Use a horizontal curvature of 0.5 to make 50 percent of each horizontal side curved. Use a vertical curvature of 1 to make both vertical sides completely curved.

rectangle('Position',[6 0 2 4],'Curvature',[0.5,1])

% Copyright 2015 The MathWorks, Inc.