www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/DrawCircleExample.m

    %% Draw Circle
% Draw a circle  by setting the |Curvature| property to |[1 1]|. Draw the
% circle so that it fills the rectangular area between the points (2,4) and
% (4,6). The |Position| property defines the smallest rectangle that
% contains the circle.

% Copyright 2015 The MathWorks, Inc.


pos = [2 4 2 2]; 
rectangle('Position',pos,'Curvature',[1 1])
axis equal


%%
% Draw a red rectangle using the same position values to show how the
% circle fills the rectangular area.

rectangle('Position',pos,'EdgeColor','r')