Main Content

pdecirc

Draw circle in PDE Modeler app

Description

example

pdecirc(xc,yc,R)draws a circle with the center at (xc,yc) and the radiusR. Thepdecirccommand opens the PDE Modeler app with the specified circle already drawn in it. If the app is already open,pdecircadds the specified circle to the app window without deleting any existing shapes.

pdecircupdates the state of the geometry description matrix inside the PDE Modeler app to include the circle. You can export the geometry description matrix from the PDE Modeler app to the MATLAB®Workspace by selectingDrawExport Geometry Description, Set Formula, Labels.... For details on the format of the geometry description matrix, seedecsg.

example

pdecirc(xc,yc,R,label)assigns a name to the circle. Otherwise,pdecircuses a default name, such asC1,C2, and so on.

Examples

collapse all

Open the PDE Modeler app window containing a circle with the center at (0,0) and the radius 1.

pdecirc(0,0,1)

Call thepdecirccommand again to draw a circle with the center at (0,0.25) and the radius 0.5. Thepdecirccommand adds the second circle to the app window without deleting the first.

pdecirc(0,0.25,0.5)

Figure PDE Modeler - [Untitled] contains objects of type uimenu, uicontrol.

Open the PDE Modeler app window containing a circle with the center at (0,0) and the radius 1. Assign the namecircle1to this circle.

pdecirc(0,0,1,"circle1")

Figure PDE Modeler - [Untitled] contains objects of type uimenu, uicontrol.

Input Arguments

collapse all

x-coordinate of the center of the circle, specified as a real number.

Data Types:double

y-coordinate of the center of the circle, specified as a real number.

Data Types:double

Radius of the circle, specified as a positive number.

Data Types:double

Name of the circle, specified as a character vector or string scalar.

Data Types:char|string

Tips

pdecircopens the PDE Modeler app and draws a circle. If, instead, you want to draw circles in a MATLAB figure window, choose one of these approaches:

  • Use theplotcommand, for example:

    t = linspace(0,2*pi); plot(cos(t),sin(t))
  • Use therectanglefunction with theCurvaturename-value pair set to[1 1].

  • Use the Image Processing Toolbox™viscircles(Image Processing Toolbox)function.

Version History

Introduced before R2006a