4.23913

4.2 | 47 ratings Rate this file 1274 downloads (last 30 days) File Size: 1.45 KB File ID: #2876

Draw a circle.

by Zhenhai Wang

 

20 Dec 2002 (Updated 23 Dec 2002)

Code covered by BSD License  

Easy circle drawing.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

Just give the center, the radius and the number of points. You can even define simple styles.

Acknowledgements
This submission has inspired the following:
circle3.m, Radial Scan, Plot the angle arc for some angle., Animate a Simple Mechanism
MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (51)
24 Mar 2003 J Kile

Easy to use, does exactly what is stated

16 Jul 2003 usman usman  
19 Feb 2004 phill t

fantastic

07 May 2004 beno hwang

thumbs up!

01 Jun 2004 Fahad Al Mahmood

Simple ... yet very smart and useful! Thanks!

18 Jun 2004 Daniel K.

nice

08 Oct 2004 Ramanathan Subramanian  
28 Jan 2005 Liu Jerry

Very Good function!
Many many thanks.

02 Feb 2005 John G.  
29 Mar 2005 hugo ferreira

Nice work

www.dee.isep.ipp.pt/~e980933
www.lsa.isep.ipp.pt
www.lsa.isep.ipp.pt/~hf

29 Mar 2005 Joel Sander

Exactly what I was looking for...

13 Apr 2005 Bob Chen  
12 May 2005 Sanith Wijesinghe

Great

24 May 2005 shankar kumar selvaraja

good

24 May 2005 James J. Cai

It works!!

09 Nov 2005 Nick Cheilakos  
24 Dec 2005 Daphne Weihs

A realy nice little basis for more complex things

31 Dec 2005 F Aries

works for me too!!!
Gee Thanx.

26 Jan 2006 Tom Haylo

Very simple, but very good!

22 Feb 2006 hirogatsu mifune

yokudekymashta!

06 Mar 2006 asdasdf asdfasdf

asdfasdfasdf

03 May 2006 Nancy Wong

short but elegent

19 Jun 2006 Alessio Perani

Useful and functional.

22 Jun 2006 LI Jia

easy to use, thanks

03 Jul 2006 Georges Aoude

Very Useful

05 Jul 2006 PRE Adrien

Great Work !
it just do the job, and well !

21 Aug 2006 Sven Mensing

Just what you need. Works perfectly

18 Sep 2006 Alev Soke

I am thankful for you.

18 Sep 2006 Yasar Becerikli  
21 Nov 2006 Konstantinos Michalakis

Thanks!

24 Nov 2006 ahmed safie

no

10 Dec 2006 Hendro Nurhadi

THANKS!!!!!! :-)

14 Dec 2006 Allan Ye

Thanks, it's the one I'm after.

06 Feb 2007 mahmoud fawzi

very helpful

17 Mar 2007 Joerg Buchholz

Matlab's built-in "rectangle" command can draw circles if you use the curvature parameter:

rectangle ('position', [0, 0, 1, 1], curvature', [1, 1])

09 May 2007 lila naseri  
31 May 2007 mohammad t moravej

nice usage of the pol2cart command.
if one is to use rectangle command to draw a circle,it should be noticed that the axis aspect ratios also should be set to equal ratiots or the circle plot will seem an ellipse.(use daspect([1 1 1])

22 Jun 2007 PONTHEP VENGSUNGNLE

Interest!
Thang you sir
From thailand

31 Jul 2007 sam s  
07 Aug 2007 Jens H.

---
t = linspace(0, 2*pi, Number_of_points);
plot(r*cos(t),r*sin(t),'style')
--
also works well!

31 Aug 2007 tom tomo  
11 Sep 2007 Jao Tao Mao Ying Ling Ping Golf

Don't eat carrots.

05 Apr 2008 eyap candir

a missing function for matlab thanks to author

25 Apr 2008 Ricardo Peligroso

Excellent function, couldn't believe that there wasn't a simple in-built one! Thank you! :)

04 May 2008 Joe Daady  
07 Aug 2008 Muhammad Ahsan

Must work with the specified starting and the ending angle.

20 Aug 2008 Klaus Hansen  
23 Sep 2008 julian rojas  
11 Jun 2009 Celal

Good solution,

08 Sep 2009 Michael Doube

Broken; produces repeated coordinate at the start and end position, so the centroid of the points is not the centre of the circle.

08 Sep 2009 Michael Doube

Sorry, I see the point - you want to close the circle. Duh.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Zhenhai Wang 22 Oct 2008 06:55:16
plotting Zhenhai Wang 22 Oct 2008 06:55:16
circle Zhenhai Wang 22 Oct 2008 06:55:16
easy Zhenhai Wang 22 Oct 2008 06:55:16
drawing Zhenhai Wang 22 Oct 2008 06:55:16
specialized plot Zhenhai Wang 22 Oct 2008 06:55:16
styles Zhenhai Wang 22 Oct 2008 06:55:16
graphics Zhenhai Wang 22 Oct 2008 06:55:16
radius Zhenhai Wang 22 Oct 2008 06:55:16
potw Cristina McIntire 07 Nov 2008 13:23:52
circle Roi Harel 03 Mar 2009 12:48:11
circle seven 12 Mar 2009 07:39:25
circle Jorge 10 Jun 2009 15:11:55
circle Bastian 25 Jun 2009 05:56:37
circle Jaka Katrasnik 24 Aug 2009 09:22:08
drawing Stacy Baber 26 Aug 2009 15:56:21
circle Stacy Baber 26 Aug 2009 15:56:27
circle Marco Brugora 30 Sep 2009 06:15:41
circle Alexander 08 Oct 2009 14:03:48
easy Harmon Amakobe 26 Oct 2009 12:06:06
drawing Harmon Amakobe 26 Oct 2009 12:06:08
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com