Code covered by the BSD License  

Highlights from
Ellipse

5.0

5.0 | 2 ratings Rate this file 6 Downloads (last 30 days) File Size: 2.01 KB File ID: #25580
image thumbnail

Ellipse

by Andrew Schwartz

 

14 Oct 2009 (Updated 23 Nov 2009)

Draws an ellipse or arc on the current or specified axes

| Watch this File

File Information
Description

Draw an ellipse. If an axes object is specified, draws on that axes, otherwise draws on the current axes. Can specify x,y position and x,y radii. The y radius can be omitted to draw a circle if no further input parameters are used. Optional parameters include tilt, arc start and end angles, number of points to plot, a line format string (like used in PLOT()) and parameter/value format pairs (like used in PLOT()).

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
23 Oct 2009 Jan Simon

H1 line, good help section, no example, date and author mentioned. The source is clean, but has no comments. Very flexible parsing of inputs with some error checks.
For run on old Matlab versions: plot(ax, ...) -> plot(x, y, varargin{:}, 'Parent', ax); I'd prefer LINE instead of PLOT, but this is a question of taste.
Summary: useful, clean, works really well.

23 Nov 2009 Richard Stephens

Is there an error on line 79? I think it should read:
y = y + rx*cos(th)*sin(t) + ry*sin(th)*cos(t);

23 Nov 2009 Andrew Schwartz

Yes indeed, that was an error. Thanks for the catch; it has been fixed now (new file currently pending approval).

20 Nov 2010 piao lin  
Please login to add a comment or rating.
Updates
16 Oct 2009

Updated help comments

28 Oct 2009

Per file comments, made compatible with older versions of MATLAB by using plot(...,'Parent',ax) instead of plot(ax,...). Added comments.

23 Nov 2009

Fixed error in handling non-zero axis tilt

Tag Activity for this File
Tag Applied By Date/Time
draw Andrew Schwartz 15 Oct 2009 10:14:01
ellipse Andrew Schwartz 15 Oct 2009 10:14:01
circle Andrew Schwartz 15 Oct 2009 10:14:01
circle Sungmin 16 Aug 2011 21:12:47
ellipse Olival do Lago 19 Oct 2011 13:36:59

Contact us at files@mathworks.com