File Exchange

## Ellipse

version 1.4 (2.01 KB) by

Draws an ellipse or arc on the current or specified axes

Updated

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()).

Stephen Cobeldick

### Stephen Cobeldick (view profile)

MATLAB also has inbuilt circle and ellipse drawing using the |rectangle| function:

http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F

http://www.mathworks.com/help/matlab/ref/rectangle.html

piao lin

Andrew Schwartz

### Andrew Schwartz (view profile)

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

Richard Stephens

### Richard Stephens (view profile)

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

Jan Simon

### Jan Simon (view profile)

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.